Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
diegohaz committed Nov 4, 2016
1 parent e40c77f commit 06e600c
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,39 +178,37 @@ You can customize the `src` and `api` directories.
src/
├─ api/
│ ├─ user/
│ │ ├─ user.controller.js
│ │ ├─ user.model.js
│ │ ├─ user.model.test.js
│ │ ├─ user.router.js
│ │ └─ user.router.test.js
│ └─ another-endpoint/
├─ config/
│ ├─ index.js
│ ├─ express.js
│ └─ mongoose.js
│ │ ├─ controller.js
│ │ ├─ index.js
│ │ ├─ index.test.js
│ │ ├─ model.js
│ │ └─ model.test.js
│ └─ index.js
├─ services/
│ ├─ express/
│ ├─ facebook/
│ ├─ mongoose/
│ ├─ passport/
│ ├─ sendgrid/
│ └─ your-service/
├─ app.js
├─ index.js
└─ routes.js
├─ config.js
└─ index.js
```

### src/api/

Here is where the API endpoints are defined. Each API has its own folder.

#### src/api/some-endpoint/some-endpoint.model.js
#### src/api/some-endpoint/model.js

It defines the Mongoose schema and model for the API endpoint. Any changes to the data model should be done here.

#### src/api/some-endpoint/some-endpoint.controller.js
#### src/api/some-endpoint/controller.js

This is the API controller file. It defines the main router middlewares which use the API model.

#### src/api/some-endpoint/some-endpoint.router.js
#### src/api/some-endpoint/index.js

This is the entry file of the API. It defines the routes using, along other middlewares (like session, validation etc.), the middlewares defined in the `some-endpoint.controller.js` file.

Expand Down

0 comments on commit 06e600c

Please sign in to comment.