Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Why is the routes file in a routes folder and labeled 'index.js'? #37

Closed
rchrdnsh opened this issue Jun 7, 2017 · 2 comments

Comments

@rchrdnsh
Copy link

rchrdnsh commented Jun 7, 2017

See below image for subject line visualization:

screen shot 2017-06-06 at 6 37 09 pm

I would have thought that the routing file would be labeled 'routes.js' or something similar.

So I guess I'm wondering if this folder structure is to encourage splitting up routing into multiple files, and if so, is there any documentation on how to go about doing so, and when it would be appropriate?

Thank you in advance for your assistance and clarification :-)

@ragingwind
Copy link
Contributor

Folders as Modules is rather convenience. If the main routes name was set by routes.js, you should import routes every time like this

import route from ./router/routes.js

But, after scaffolding, how to organize the directory structure and named a filename is depends on your opinion.

@rchrdnsh
Copy link
Author

hmmm...gonna dig more into these concepts, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants