Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
},
store: {
memory: {
limit: 1000
}
}
};
const addr = {
port: port,
path: '/',
host: 'localhost'
};
startServer(config, port, store, '1.0.0', 'verdaccio', (webServer, addrs, pkgName, pkgVersion) => {
webServer.listen(addr.port || addr.path, addr.host, () => {
// This is logged to tell whoever spawns us that we're ready.
console.log('verdaccio running');
console.dir({ addrs });
});
});
}
});
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);
packages,
max_body_size: '100mb',
logs: [{
type: 'file',
path: path.join(storage, 'verdaccio.log'),
format: 'pretty-timestamped',
level: 'info'
}],
web: { enabled: false },
publish: { allow_offline: true }
};
debug(`Verdaccio config (publishing mode: ${forPublishing}): ${JSON.stringify(config, null, 2)}`);
try {
// tslint:disable-next-line:no-var-requires
require('verdaccio').default(config, 6000, config.storage, '1.0.0', 'verdaccio', verdaccioHandler);
} catch (e) {
error(`Failed to start verdaccio: ${e.stack}`);
reject(e);
}
});
}
access: '$all',
proxy: 'npmjs'
}
},
max_body_size: '100mb',
logs: [{
type: 'file',
path: path.join(storage, 'verdaccio.log'),
format: 'pretty-timestamped',
level: 'info'
}]
};
try {
// tslint:disable-next-line:no-var-requires
require('verdaccio').default(config, 6000, config.storage, '1.0.0', 'verdaccio', verdaccioHandler);
} catch (e) {
reject(e);
}
});
}
const server = await new Promise((resolve, reject) => {
try {
startVerdaccio(config, config.listen, configPath, "1.0.0", "verdaccio",
(webServer: http.Server, addr: any, _pkgName: any, _pkgVersion: any) => {
webServer.on("error", reject);
webServer.listen(addr.port || addr.path, addr.host, () => {
resolve(webServer);
});
});
} catch (err) {
reject(err);
}
});