mirror of
https://github.com/SomboChea/ui
synced 2024-11-05 14:14:26 +07:00
96b65d969a
* refactor: corrects eslint and variable namespacing * chore: fixes git conflict * chore: fixes eslint
24 lines
642 B
JavaScript
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);
|