@abtnode/service-loader
v1.6.22
Published
Aggregator to mount and make sure all blocklet services run in the same process
Downloads
283
Readme
ABT Node Service Server
Aggregator to mount all blocklet services and make them work together.
Usage
yarn add @abtnode/service-server
Then:
const createServer = require('@abtnode/service-server');
const ABTNode = require('@abtnode/core');
const node = ABTNode({ ...nodeOptions });
const server = createServer(node, { ...globalOptions });
server.mountService('@abtnode/auth-service', { ...loginServiceOptions });
server.mountService('@abtnode/acl-service', { ...aclServiceOptions });
server.mountService('@abtnode/payment-service', { ...paymentServiceOptions });
node.onReady(() => {
server.listen(5000, () => {
console.log('ABT Node Service server ready on port 5000');
});
});
FAQ?
Service Options vs Configurations
- Options: alter global ways that service works, such as
dataDir
, the loader and each service can have their own options, and the loader options are merged into service options - Configurations: customize how each service handles the request on a certain URL mapping