How should I configure create-react-app to serve app from subdirectory?

前端 未结 6 1151
死守一世寂寞
死守一世寂寞 2020-12-08 02:59

I have classic web application rendered on server. I want to create admin panel as single page application in React. I want to server admin panel from https://smyapp.example

6条回答
  •  一向
    一向 (楼主)
    2020-12-08 03:27

    put in package.json something like this:

    "homepage" : "http://localhost:3000/subfolder",

    and work fine on any public or local server. Of course, subfolder must be your folder.

提交回复
热议问题