After running next export and opening the out/index.html on my dev machine in the browser, the links won't work. E.g a link to /courses will point to file:///courses/.
Also, assets from the /static folder won't be linked properly either. E.g if there's an <img src='/static/bla.png'>, it will try to load it from file:///static/bla.png.
Is there any way to fix this within next.js to allow testing exports locally instead of needing to deploy every time?
You don't need to deploy it. Just run a local HTTP server. Here's the simplest one:
python -m SimpleHTTPServer
Then you can access your app in http://localhost:8080
Serving the folder directory without a HTTP server is not a goal we need to go for.
You can also use serve -s (npm install -g serve) from ZEIT 馃憣
Most helpful comment
You don't need to deploy it. Just run a local HTTP server. Here's the simplest one:
Then you can access your app in http://localhost:8080
Serving the folder directory without a HTTP server is not a goal we need to go for.