How to use the egg-core.EggCore function in egg-core

To help you get started, we’ve selected a few egg-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eggjs / egg-core / test / fixtures / egg / index.js View on Github external
'use strict';

const fs = require('fs');
const path = require('path');
const rimraf = require('mz-modules/rimraf');

const eggPath = path.join(__dirname, 'node_modules/egg-core');
rimraf.sync(eggPath);
fs.symlinkSync(
  path.join(__dirname, '../../..'),
  eggPath,
  'dir'
);

const EggCore = require('egg-core').EggCore;
const EggLoader = require('egg-core').EggLoader;

class AppLoader extends EggLoader {
  loadAll() {
    this.loadPlugin();
    this.loadConfig();
    this.loadApplicationExtend();
    this.loadContextExtend();
    this.loadRequestExtend();
    this.loadResponseExtend();
    this.loadCustomApp();
    this.loadMiddleware();
    this.loadService();
    this.loadController();
    this.loadRouter();
  }
github eggjs / egg-core / test / fixtures / egg / index.js View on Github external
'use strict';

const fs = require('fs');
const path = require('path');
const rimraf = require('mz-modules/rimraf');

const eggPath = path.join(__dirname, 'node_modules/egg-core');
rimraf.sync(eggPath);
fs.symlinkSync(
  path.join(__dirname, '../../..'),
  eggPath,
  'dir'
);

const EggCore = require('egg-core').EggCore;
const EggLoader = require('egg-core').EggLoader;

class AppLoader extends EggLoader {
  loadAll() {
    this.loadPlugin();
    this.loadConfig();
    this.loadApplicationExtend();
    this.loadContextExtend();
    this.loadRequestExtend();
    this.loadResponseExtend();
    this.loadBootHook();
    this.loadCustomApp();
    this.loadMiddleware();
    this.loadService();
    this.loadController();
    this.loadRouter();
github eggjs / egg / lib / egg.js View on Github external
'use strict';

const path = require('path');
const fs = require('fs');
const ms = require('ms');
const http = require('http');
const EggCore = require('egg-core').EggCore;
const cluster = require('cluster-client');
const extend = require('extend2');
const ContextLogger = require('egg-logger').EggContextLogger;
const ContextCookies = require('egg-cookies');
const CircularJSON = require('circular-json-for-egg');
const ContextHttpClient = require('./core/context_httpclient');
const Messenger = require('./core/messenger');
const DNSCacheHttpClient = require('./core/dnscache_httpclient');
const HttpClient = require('./core/httpclient');
const createLoggers = require('./core/logger');
const Singleton = require('./core/singleton');
const utils = require('./core/utils');
const BaseContextClass = require('./core/base_context_class');
const BaseHookClass = require('./core/base_hook_class');

const HTTPCLIENT = Symbol('EggApplication#httpclient');

egg-core

A core Pluggable framework based on koa

MIT
Latest version published 1 year ago

Package Health Score

67 / 100
Full package analysis