Y
Y
Yura Yurievich2017-03-07 15:52:32
JavaScript
Yura Yurievich, 2017-03-07 15:52:32

Is it the right framework for a NodeJS server?

Here for the future web part, I made myself such a structure.
Why did I do it? To differentiate all files into categories and folders, well, to give a semblance of MvC.
I plan to use such a structure in the future, but is it right? Is it worth starting to do something on it, or will it all end badly in the future?
Please evaluate my creation, and give reasonable and not very advice). thank!
On GitHub e
In short:
| server.js // main server code
| bootstrap.js // connects everything, initializes controllers, intermediate code, etc, starts the server
| models // models of tables in the database + methods.
| controllers// there is 1 file that initializes the rest of the controllers, 1 controller - 1 folder.
| middleware // middleware, we define different modules (for example, separate access, sending headers, etc.)
| config // Any configuration files (in particular, connecting to the database, JWT, etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Skrolea, 2017-03-07
@Skrolea

I prefer it broken down into modules
--- moduleName
-----config
-----controllers
-----models
...
Or even like this
https://github.com/meanjs/mean/tree/master/ modules...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question