1
0
mirror of https://github.com/SomboChea/ui synced 2024-12-26 06:04:31 +07:00
verdaccio-ui/tools/verdaccio.js
Priscila Oliveira ae73772a37 feat(eslint-config): add order rule in import
* refactor: added eslint-plugin-import

* refactor: disable some rules for muiComponents

* fix: fixed import
2019-10-07 22:19:18 +02:00

28 lines
949 B
JavaScript

const fs = require('fs');
const path = require('path');
const startServer = require('verdaccio').default;
const yalm = require('js-yaml');
const storageLocation = path.join(__dirname, '../partials/storage');
const pluginsLocation = path.join(__dirname, '../partials/plugins');
const configJsonFormat = Object.assign({}, yalm.safeLoad(fs.readFileSync('./tools/_verdaccio.config.yaml', 'utf8')), {
storage: storageLocation,
plugins: pluginsLocation,
});
const serverHandler = 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('verdaccio server has been shutdown');
});
});
};
// https://verdaccio.org/docs/en/node-api
startServer(configJsonFormat, 8080, '', '1.0.0', 'verdaccio', serverHandler);