Reputation: 11
I've been building a project with astro, everything worked perfectly fine in the dev mode and the preview mode but whenever I build the app all routes just point to the index.astro file and if I delete it, there is basically no routes at all.
In order to identify the problem, I tried replicating the problem on a smaller scale and it just doesn't seem to not work even on the simplest form of app.
I'm really confused, this problem seems so basics that I feel certain I'm probably the one missing something.
If anybody have any solution, it would be of a great help, thank you !
ty
├── src/
│ └── pages/
│ └── index.astro
|__ agenda.astro
|-- serie.astro
|deuxieme_etage/maison.astrope here
They all work as espected when I run npm start, npm run preview but whenever I get the build version with npm run build, it doesn't.
I served it using serve -s dist doesn't work, also tried it on my production website also and it doesn't.
Upvotes: 0
Views: 1729
Reputation: 11
Turns out the serve -s dist commands
only return a single page website so the right command would be to use serve dist
.
Also in my astro.config file I declared the build format to 'file', that fixed the problem on my production server.
Upvotes: 1