@abtnode/service-loader

1.6.22 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @abtnode/service-loader

Weekly Downloads

126

Version

1.6.22

License

MIT

Unpacked Size

17.1 kB

Total Files

6

Last publish

Collaborators

  • wangshijun
  • polunzh
  • mave99a