Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private setupServer(modules: IApiModules): IFastifyServer {
const server = fastify.default({
//TODO: somehow pass winston here
logger: false,
querystringParser: qs.parse
}) as IFastifyServer;
if(this.opts.cors) {
const corsArr = this.opts.cors.split(",");
server.register(fastifyCors, {
origin: corsArr
});
}
if(this.opts.api.includes(ApiNamespace.BEACON)) {
//@ts-ignore
server.register(routes.beacon, {prefix: "/node", modules});
}