How to integrate Strapi API and Admin Panel with another node app (that consumes Strapi API)?

假如想象 提交于 2019-12-04 15:39:06

Okay I just played with the routing prefix and that is the solution I suggest you.

So you will have to build you website app. And push the build in the ./public folder of the Strapi application.

Then in your api/.../config/routes.json files you will have to add an option prefix in the config key of each of your routes and for all your APIs

{
  "routes": [
    {
      "method": "POST",
      "path": "/restaurants",
      "handler": "Restaurant.create",
      "config": {
        "policies": [],
        "prefix": "/api"
      }
    }
  ]
}
  • So at the end you will have your admin on /admin
  • Your APIs endpoints prefixed by /api
  • And your website/assets on /
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!