Adding routes
Routes allow us to access the defined resources
To create the basic routes we will add a new file to the domain we are working on calledroutes.js
. This file will import auxiliary functions for creating routes and thedomain
andpath
values of the previously created file.
It is possible to notice that the auxiliary functions play a fundamental role in this file. They will use the components we create and create all 5 routes that will be responsible for designing the screens.
This file must always return an array
so that it can be registered in the module'srouteFile
in which it will be used, to see more about route manipulation check the Routes page
After creating the route file, we must register it in the most appropriate aggregationrouteFile
. In our case it issrc/modules/Dashboard/router/routeFile.js
and this will vary according to the organization created for the project. We can create other modules or files to aggregate other files in other domains.
After adding the routes we created, therouteFile
will look similar to the excerpt below.
After everything we've done so far, you can see the screens that have been pre-configured. The next step in the tutorial is to see this result and understand the concepts of how to work with it.
Last updated
Was this helpful?