mirror of
https://github.com/strapi/strapi.git
synced 2025-12-25 14:14:10 +00:00
Fix Strapi prototype
This commit is contained in:
parent
0125c4c261
commit
b9f14866a8
@ -36,6 +36,17 @@ function Strapi() {
|
||||
// Mixin support for `Strapi.prototype.after()`.
|
||||
mixinAfter(this);
|
||||
|
||||
// Bind `this` context for all `Strapi.prototype.*` methods.
|
||||
this.load = this.load.bind(this);
|
||||
this.start = this.start.bind(this);
|
||||
this.stop = this.stop.bind(this);
|
||||
this.restart = this.restart.bind(this);
|
||||
this.initialize = this.initialize.bind(this);
|
||||
this.exposeGlobals = this.exposeGlobals.bind(this);
|
||||
this.runBootstrap = this.runBootstrap.bind(this);
|
||||
this.isLocalStrapiValid = this.isLocalStrapiValid.bind(this);
|
||||
this.isStrapiAppSync = this.isStrapiAppSync.bind(this);
|
||||
|
||||
// Expose `koa`.
|
||||
this.server = require('koa');
|
||||
this.app = require('koa')();
|
||||
|
||||
@ -12,6 +12,13 @@ const Strapi = require('./Strapi');
|
||||
* (maintains backwards compatibility with constructor usage).
|
||||
*/
|
||||
|
||||
module.exports = function () {
|
||||
module.exports = strapiFactory;
|
||||
|
||||
function strapiFactory() {
|
||||
return new Strapi();
|
||||
};
|
||||
}
|
||||
|
||||
// Backwards compatibility for Strapi singleton usage.
|
||||
const singleton = strapiFactory();
|
||||
strapiFactory.isLocalStrapiValid = singleton.isLocalStrapiValid.bind(singleton);
|
||||
strapiFactory.isStrapiAppSync = singleton.isStrapiAppSync.bind(singleton);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user