Change: OpenApiValidator to only be created in dev

This commit is contained in:
Nicholas Wallace 2024-06-16 19:50:47 +00:00
parent 0122f88b46
commit ac4bd0a558

View file

@ -205,6 +205,7 @@ class Server {
}) })
// Install the OpenApiValidator middleware // Install the OpenApiValidator middleware
if (Logger.isDev) {
const apiSpec = Path.join(__dirname, 'openapi.json') const apiSpec = Path.join(__dirname, 'openapi.json')
app.use( app.use(
OpenApiValidator.middleware({ OpenApiValidator.middleware({
@ -229,6 +230,7 @@ class Server {
ignoreUndocumented: true ignoreUndocumented: true
}) })
) )
}
// parse cookies in requests // parse cookies in requests
app.use(cookieParser()) app.use(cookieParser())