1
0
mirror of https://github.com/SomboChea/ui synced 2024-12-26 06:04:31 +07:00
verdaccio-ui/tools/verdaccio.js
Ayush Sharma 96b65d969a refactor: corrects eslint and variable name spacing (#31)
* refactor: corrects eslint and variable namespacing

* chore: fixes git conflict

* chore: fixes eslint
2019-04-08 22:29:20 +02:00

24 lines
642 B
JavaScript

/**
* @prettier
*/
const fs = require('fs');
const startServer = require('verdaccio').default;
const yalm = require('js-yaml');
const configJsonFormat = yalm.safeLoad(fs.readFileSync('./tools/_config.yaml', 'utf8'));
const handler = function(webServer, addr, pkgName, pkgVersion) {
webServer.listen(addr.port || addr.path, addr.host, () => {
console.log(`${pkgName}:${pkgVersion} running ${addr.proto}://${addr.host}:${addr.port}`);
});
process.on('SIGTERM', () => {
webServer.close(() => {
console.log('Process terminated');
});
});
};
startServer(configJsonFormat, 8080, '', '1.0.0', 'verdaccio', handler);