只有在测试环境才加上跨域组件

This commit is contained in:
zhl 2023-03-02 15:59:30 +08:00
parent 4258a7fd26
commit df085e9616

View File

@ -35,8 +35,9 @@ export class ApiServer {
secret: config.api.token_secret,
expiresIn: config.api.token_expiresIn,
})
this.server.register(require('@fastify/cors'), {})
if (process.env.NODE_ENV !== 'production') {
this.server.register(require('@fastify/cors'), {})
}
}
private registerRouter() {