简体   繁体   中英

How to use the Keystone.js admin api (unauthed) in my app?

I was taking a look at this the docs on the admin api and realized that it perfectly solves my case of using Keystone to power a SPA. However, I can't figure out a way to access the admin api routes from the api routes that I'm building without forcing an auth event first.

Anyone have suggestions for how I could accomplish this?

After a bit of trial and error I came to a solution that I'm pretty happy with. I took a good look at keystone/admin/server/app/createDynamicRouter.js and copied the functionality from there, and also duplicated keystone/admin/server/middleware/initList.js.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM