Skip to content

Specifying the starting url path in npm start #2959

@steveareeno

Description

@steveareeno

I found out how to change the starting path in my app for the production build using the "homepage" setting in the package.json.

"homepage":"http//server-name/MyApp"

For this to work I also had to change my routes (using react-router) to include the subdirectory:

<Route path="/MyApp" components={App}>

This works great in prod but when I run npm start during development, I have to manually add "MyApp" to the url. Is there any way I can set this so it npm start runs the app as follows:

http://localhost:3000/MyApp

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions