Forked from vuongtran/RESTful API sample structure using Node.js, Express.js included tesing
Created
September 27, 2017 06:03
-
-
Save nimatrazmjo/cde684ea0537bee9f599f9015f4c53e7 to your computer and use it in GitHub Desktop.
RESTful API sample structure using Node.js, Express.js included tesing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Let's lool at the following example structure for RESTful API using Node.js, Express.js included tesing | |
app/ | |
|---models/ | |
|---controller/ | |
|---helpers/ | |
|---middlewares/ | |
|---tests/ | |
|---models/ | |
|---controllers/ | |
|---middlewares/ | |
|---node_modules/ | |
|---app.js | |
|---package.json | |
models/ – represents data, implements business logic and handles storage | |
controllers/ – defines your app routes and their logic | |
helpers/ – code and functionality to be shared by different parts of the project | |
middlewares/ – Express middlewares which process the incoming requests before handling them down to the routes | |
tests/ – tests everything which is in the other folders | |
node_modules/ - all npm requried for app | |
app.js – initializes the app and glues everything together | |
package.json – remembers all packages that your app depends on and their versions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment