https://github.com/fed/recipes-api
Recipes RESTful API 👨🍳
https://github.com/fed/recipes-api
express nodejs recipes restful-api
Last synced: about 2 months ago
JSON representation
Recipes RESTful API 👨🍳
- Host: GitHub
- URL: https://github.com/fed/recipes-api
- Owner: fed
- Created: 2020-02-09T05:20:44.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-10T05:07:05.000Z (about 5 years ago)
- Last Synced: 2025-01-18T13:33:11.525Z (3 months ago)
- Topics: express, nodejs, recipes, restful-api
- Language: JavaScript
- Homepage: https://recipes-api.fknussel.com/
- Size: 85 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# recipes-api
## Prerequisites
- Node.js (https://nodejs.org/)
- Yarn (https://yarnpkg.com/)## Development Tasks
| Command | Description |
| -------------- | ---------------------------------------------------------------------------- |
| `yarn install` | Fetch dependencies and build binaries for any of the modules |
| `yarn start` | Run the app on production |
| `yarn watch` | Start the app [for development](http://localhost:6789) and watch for changes |## Architecture
* **Routes:** The `routes` directory contains all of the route definitions for the different data models. Here we define all endpoints, bind them to an HTTP verb and a controller, and mark them as protected if needed. This is where you want to look at if you need to enable/disable existing routes or create new ones.
* **Controllers:** Each endpoint has its own controller. Controllers are in charge of calling services and returning a response to the user. If you need to tweak any of the endpoints' responses (i.e. the "shape" of the response), this is where you should have a look at.
* **Services:** Services talk to the ORM. They can create, update, remove and retrieve stuff from the database. If you somehow need to get more or fewer data from the database for a particular endpoint, you need to tweak the corresponding service.
* **Models:** The definition for each one of the entities in our application live within the `models` directory. Changes to the database structure should be directly reflected on our models.