mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
45c03819e2
* refactor: render middleware * refactor: render middleware
26 lines
746 B
TypeScript
26 lines
746 B
TypeScript
import { Application } from 'express';
|
|
import path from 'path';
|
|
|
|
import apiMiddleware from '@verdaccio/api';
|
|
import { parseConfigFile } from '@verdaccio/config';
|
|
import { setup } from '@verdaccio/logger';
|
|
import { Storage } from '@verdaccio/store';
|
|
import { initializeServer as initializeServerHelper } from '@verdaccio/test-helper';
|
|
|
|
import routes from '../src';
|
|
|
|
setup({});
|
|
|
|
export const getConf = (configName: string) => {
|
|
const configPath = path.join(__dirname, 'config', configName);
|
|
return parseConfigFile(configPath);
|
|
};
|
|
|
|
// @deprecated
|
|
export async function initializeServer(configName): Promise<Application> {
|
|
return initializeServerHelper(
|
|
getConf(configName),
|
|
[apiMiddleware, { async: true, routes }],
|
|
Storage
|
|
);
|
|
}
|