skip to Main Content

I want to create an admin project, but now I have some questions about routing method. There are Convention Routing(like next.js) and Configuring Routing(like umijs, vue-element-admin), I don’t know which one I should use.
Can you tell me the shortcoming and advantage about them?

I try read docs and google, but there is little article about this topic.

2

Answers


  1. In simple terms:

    Convention Routing (Automated Routing) is a quicker and easier method of defining routes based on a set of conventions.

    Example: Next.js


    Configuring Routing (Manual Routing) offers greater control and flexibility over routing behaviour but can take longer and be more difficult to set up.

    Example: Umi.js

    Login or Signup to reply.
  2. I would use the routing best supported by the framework you pick. For Next.js use their file system based routing https://nextjs.org/docs/routing/introduction if you rather use create-react-app or vue.js then use their recommendation. But to better answer your specific question ->

    Convention Routing like the one used in Next.js on a high level allows the developer to set up their folder structures to essentially be their routes. This is very intuitive and easy to get set up as you would do this anyways. It is also the way vanilla PHP does it and the way most servers would serve static content.

    Configuration Routing the main advantage for configuration routing is that it allows more control over how the routes are set up and nested. It also frees you to have any folder/file structure you’d like.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search