service-provider-starter
v0.0.2
Published
It's Service Provider Core starter
Downloads
3
Readme
Service-Provider-Starter
It's Service Provider Core starter
Getting Started
- Clone project.
$ git clone https://github.com/meanstack-io/service-provider-starter.git yourProjectName
- Create your environment file.
$ cd yourProjectName && cp .env-example.js .env.js
- Run.
$ npm start
Service Provider
Service Provider are the central place of your application.
Method Register
Responsible for registering your new service to the core.
Method Boot
This method is called after all other service providers have been registered, which means that you have access to all other services that have been registered.
Base Service Provider
/**
* Module dependencies.
*/
const ServiceProvider = require('service-provider-core/support/ServiceProvider');
/**
* YourServiceProvider
*
* @type {Function}
*/
let YourServiceProvider = ServiceProvider.extend(function(Core) {
this.Core = Core;
});
/**
* YourServiceProvider register
*
* @param done
*/
YourServiceProvider.prototype.register = function (done) {
//
done();
};
/**
* YourServiceProvider boot
*
* @param done
*/
YourServiceProvider.prototype.boot = function (done) {
//
done();
};
module.exports = YourServiceProvider;
Copyright & License
Copyright © 2017 MEANStack.io - Licensed under MIT.