diff --git a/docs/content/advanced/backend/endpoints/add-admin.md b/docs/content/advanced/backend/endpoints/add-admin.md index 3a85231e7f..65d9ff7117 100644 --- a/docs/content/advanced/backend/endpoints/add-admin.md +++ b/docs/content/advanced/backend/endpoints/add-admin.md @@ -66,11 +66,11 @@ const corsOptions = { } ``` -Finally, for each route you add, create an `OPTIONS` request: +Finally, for each route you add, create an `OPTIONS` request and add `cors` as a middleware for the route: ```js router.options("/admin/hello", cors(corsOptions)) -router.get("/admin/hello", (req, res) => { +router.get("/admin/hello", cors(corsOptions), (req, res) => { //... }) ```