mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-23 22:27:34 -05:00
00d1d2a179
* chore: relocate package server * chore: relocate server packages * Update ci.yml * rename packages * rename package * chore: refactor fastify endpoints * chore: fix types requests * fix warnings * chore: refactor endpoints * refactor launch fastify * Update package.json * chore: update deps * Create green-yaks-divide.md
32 lines
1,011 B
TypeScript
32 lines
1,011 B
TypeScript
import buildDebug from 'debug';
|
|
import path from 'path';
|
|
|
|
import { parseConfigFile } from '@verdaccio/config';
|
|
import { logger, setup } from '@verdaccio/logger';
|
|
|
|
import server from '../src/index';
|
|
|
|
const debug = buildDebug('verdaccio:fastify:debug');
|
|
|
|
/**
|
|
* This file is intended for fast development and debug, it should
|
|
* be removed eventually and the app start from @verdaccio/cli package.
|
|
*/
|
|
(async () => {
|
|
try {
|
|
const configFile = path.join(__dirname, './fastify-conf.yaml');
|
|
debug('configFile %s', configFile);
|
|
const configParsed = parseConfigFile(configFile);
|
|
setup(configParsed.log);
|
|
logger.info(`config location ${configFile}`);
|
|
debug('configParsed %s', configParsed);
|
|
process.title = 'fastify-verdaccio';
|
|
const ser = await server({ logger, config: configParsed });
|
|
await ser.listen(4873);
|
|
logger.info('fastify running on port 4873');
|
|
} catch (err: any) {
|
|
// eslint-disable-next-line no-console
|
|
console.error(err);
|
|
process.exit(1);
|
|
}
|
|
})();
|