I have a react App. With webpack I build for production. Now I try to set a little koa server to serve the static files generated by webpack for production.
So I did this
import Koa from 'koa'
import serve from 'koa-static'
const app = new Koa()
app.use(serve('dist/'))
app.listen(3001)
Where dist/
is the directory where are the files (index.html, bundle etc).
This works well but only for the route '/' (localhost:3001/)
In my app I use react router so I need to go to /login (localhost:3001/login) by example. But when I try I get "Not Found". With the devServer (by webpack) this route works well. I just need to always serve /dist, whatever the route. How to do this whit koa ?