From 1767019c04a44238fe14e6cce8dacd50595a5092 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 19 Dec 2024 22:52:58 +0100 Subject: [PATCH] docs(config): document `openAPI.production` option (#2940) --- docs/3.config/0.index.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/3.config/0.index.md b/docs/3.config/0.index.md index 929f772ab7..7c3f58cca9 100644 --- a/docs/3.config/0.index.md +++ b/docs/3.config/0.index.md @@ -64,6 +64,16 @@ openAPI: { } ``` +Theses routes are disabled by default in production. To enable them, use the `production` key. +`"runtime"` allows middleware usage, and `"prerender"` is the most efficient because the JSON response is constant. + +```js +openAPI: { + // IMPORTANT: make sure to protect OpenAPI routes if necessary! + production: "runtime", // or "prerender" +} +``` + If you like to customize the Scalar integration, you can [pass a configuration object](https://github.com/scalar/scalar) like this: ```js