@restmatic/server
Version:
The core Pomegranate plugins for RestMatic
31 lines • 924 B
JavaScript
;
/**
* @file ExpressServer
* @author Jim Bulkowski <jim.b@paperelectron.com>
* @project server
* @license MIT {@link http://opensource.org/licenses/MIT}
*/
Object.defineProperty(exports, "__esModule", { value: true });
const plugin_tools_1 = require("@pomegranate/plugin-tools");
exports.ExpressServerPlugin = plugin_tools_1.CreatePlugin('action')
.variables({
port: 8080,
address: 'localhost'
})
.configuration({
name: 'ExpressServer',
depends: ['@restmatic/PostRouter']
})
.hooks({
load: () => {
},
start: (Express, PluginVariables, PluginStore, PluginLogger) => {
PluginStore.server = Express.listen(PluginVariables.port, () => {
PluginLogger.log(`Started RestMatic server on port ${PluginVariables.port}`);
});
},
stop: (PluginStore) => {
PluginStore.server.close();
}
});
//# sourceMappingURL=ExpressServer.js.map