From 97f8ce39fc0fedcf0f611210e7dbd83d89f78318 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Mon, 30 May 2022 12:14:56 +0300 Subject: [PATCH] docs: fix for admin endpoints --- docs/content/advanced/backend/endpoints/add-admin.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) => { //... }) ```