0
I am interested in separating my app by module
app
controllers
views
diretivas
services
--modules
----principal
--------controllers
--------views
--------service
--------index.html
----cadastro
--------controllers
--------views
--------service
--------index.html
----financeiro
--------controllers
--------views
--------service
--------index.html
app.js
Being the first controller and views folder that would be the login and template of my system However all the examples I find, each module has its routes
would have as just a file manipulate all routes of all modules?
speaks rafael, so man, this way ceases to be modular, which is how I made my app. As for routes, because it’s an enterprise app, I don’t want you to keep track of all routes in a single file, and that, after logging in, the routes should be created according to your permission, coming from the Api, but thank you for responding
– Rod
Rod, I understand the modular thing, but I confess I don’t fully understand what you need. I understood that the routes need to be in their respective modules, but you also want to create routes dynamically after login? And, what kind of manipulation is this that you need in a single file?
– rafaels88
Rafael, then, in login, I do not want to expose all my routes, so I would redirect to a module, and after login create these routes dynamically, that would come from the return of the API
– Rod
But why can’t these routes be created before login? If the user accesses a url that is not allowed for some reason, you redirect it. Create a Userservice for that. I figure every URL he accesses, you need to access the API to get his data, right? Will your API return saying that the user is not logged in? If so, this Userservice will do this access control. Got confused?
– rafaels88
The problem, that being a corporate app, right on the login screen there will be all routes, then, anyone can see all my work modules, and even idea of what is my app, which who should know the news and etc is just my final customer. All access control is done via api yes, and is redirected if you do not have access
– Rod
Just explain this part: "soon on the login screen there will be all routes". There will be how exactly?
– rafaels88
rafael, if all the routes will be in the app.js file, just go to the source code of the page and you will have all the routes
– Rod
Okay, I get it. I’m working on a solution.
– rafaels88