fridays / next-routes

Universal dynamic routes for Next.js
MIT License
2.47k stars 230 forks source link

original next file system routes still work? #149

Closed terencechow closed 6 years ago

terencechow commented 6 years ago

if I want to to have the parameterized route /blog/:id and i use the file /page/blog.js it appears that someone can just enter /page/blog in the url and it will work.

My setup is more or less a direct copy of the example in the readme.

Anyway we can prevent this? Otherwise it apears blog.js will be pointing to 2 routes, one from the next routing system and one from next-routes

ex3ndr commented 6 years ago

You have to disable it in next.config.js.

jaydenseric commented 6 years ago

Here is the docs link: https://github.com/zeit/next.js#disabling-file-system-routing

// next.config.js
module.exports = {
  useFileSystemPublicRoutes: false
}