piotrwitek / react-redux-typescript-jspm-starter

Futuristic, bundle-free, development environment for building Component-Driven SPA with React, Redux and TypeScript - powered by JSPM (SystemJS & Rollup with tree-shaking)
https://piotrwitek.github.io/react-redux-typescript-jspm-starter/
MIT License
231 stars 43 forks source link

Set base to / to allow navigation straight to nested paths #51

Closed chooty closed 7 years ago

chooty commented 7 years ago

Currently you can't navigate directly to a nested path by typing the url directly in the browser. This fails because the relative paths in the script tags of index.html.

To reproduce: Launch the project using npm run dev Navigate directly to http://localhost:3000/a/b

Expected: The * route is matched and the NotFoundContainer is displayed

Actual: Page fails to load due to 404 errors from trying to load the scripts in index.html relative from http://localhost:3000/a

This also affects any explicitly defined route which is more than one level deep. If one were to create the route /a/b and try to directly navigate to it the same thing happens.

I'm not sure if there's a better way to solve this, currently you have to update in multiple places if you want to have your application served from a subdirectory rather than the server root.

The change in app.tsx is simply to avoid using deprecated functionality and avoid console warnings. It will work with just the html changes, though display a warning in the console when first loading the application.

piotrwitek commented 7 years ago

@chooty please check #52 if this is working for you

chooty commented 7 years ago

@piotrwitek Yup, #52 fixes this