docs: fix for admin endpoints

This commit is contained in:
Shahed Nasser
2022-05-30 12:14:56 +03:00
committed by GitHub
parent 9529f4ae80
commit 97f8ce39fc

View File

@@ -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) => {
//...
})
```