ExpressServer
Control the setup process of Express apps services and dependencies.
Install
$ npm install --save express-server-control
Usage
import { ExpressServer } from 'express-server-control';
export const mainServer = new ExpressServer({
port: 8080,
name: 'mainServer',
beforeConfig: [
loadfKeys,
initDbConnection,
],
middleware: [
compression(),
cookieParser(),
],
tests: [
testDB()
],
afterListen: [
InitWebSockets
]
});
try {
await MainServer.config();
await mainServer.listen();
} catch (e) {
console.error(e);
}
Further information coming soon...