latus/packages/http/src/index.js

26 lines
623 B
JavaScript
Raw Normal View History

2020-11-30 06:28:29 -06:00
import {createHttpServer} from './server';
2020-12-01 15:36:14 -06:00
let httpServer;
2020-11-30 06:28:29 -06:00
// eslint-disable-next-line import/prefer-default-export
export const $$latus = {
hooks: {
2020-12-01 18:37:19 -06:00
'@latus/core/config': () => ({
2020-12-01 19:47:48 -06:00
middleware: [],
2020-12-01 18:37:19 -06:00
host: '0.0.0.0',
port: 32340,
}),
2020-12-01 02:44:31 -06:00
'@latus/core/build': (configs) => {
2020-12-02 17:13:54 -06:00
// eslint-disable-next-line global-require, no-param-reassign
configs.client = require('./build/.neutrinorc');
2020-11-30 06:28:29 -06:00
},
2020-12-02 01:16:50 -06:00
'@latus/core/up': async (plugins, next) => {
2020-12-01 15:36:14 -06:00
httpServer = await createHttpServer(plugins);
2020-12-02 01:16:50 -06:00
next();
2020-12-01 15:36:14 -06:00
},
'@latus/repl/context': () => ({
httpServer,
}),
2020-11-30 06:28:29 -06:00
},
};