Reputation: 165
I have a project with React
and nextJS
which provides pre-built images at a path like http://example.com/img/123ab53424
(fetched from an API, the 123...
part being the uuid returned from the API).
I've built a custom server.js
(code in this gist) since SSR isn't working out of the box but my /img/:id
calls yield 404 errors.
Update: I forgot to mention that it is built so that inside /pages/
there is a [id].js
file, so I guess my /img/:id
route doesn't cut it here...
Is there a step missing or something malformed in my server.js
? Any help appreciated ;)
Upvotes: 0
Views: 1163
Reputation: 165
Thanks to all posters, I've refactored my code with next-routes
and changes to server.js
, now it works as intended :)
Upvotes: 1