@gospime/racer-services
v1.2.0
Published
Plugin for conveniently adding and grabbing services (as in service layer services) to Racer or Derby.js
Downloads
13
Maintainers
Readme
Plugin for conveniently adding and grabbing services (as in service layer services) to Racer or Derby.js
How to include the plugin:
import path from 'path';
// Create a derby instance
import derby from 'derby';
// `../services` - path to the folder with your services. Every service must have own folder inside of it.
const PATH_TO = path.resolve(__dirname, '../services');
// Include the plugin
derby.serverUse(module, '@gospime/racer-services', PATH_TO);
How to use a sevice inside of your backend application:
// create an instance of service
const service = model.service('some-awesome-service'[, ...parameters]);