Friday 28 February 2020

Is there any intelligent way to handle pathing/routing across folders?

So I'm learning node and making a website and I decided on a different folderstructure than express makes. I instead went the "folder per component/domain" type of setup.But that means that instead of having a routes folder with various subfolders I have a routefile+pug etc in its own domain/component specific folder and it gets really old fiddling around with '../../views/layout' type of pathing. Is there any good solution for that? Also any good solution for the same with routes and nesting routes (ie users/api users/api/sub1 users/api/sub2 etc)?thanks and have a great weekend!

Submitted February 28, 2020 at 01:03PM by Kukibur

No comments:

Post a Comment