https://github.com/hennyfeliz/nodejs-express-mysql-api-rest
A simple rest api with nodejs and express, plus databases with mysql
https://github.com/hennyfeliz/nodejs-express-mysql-api-rest
apirest database expressjs mysql nodejs
Last synced: 3 months ago
JSON representation
A simple rest api with nodejs and express, plus databases with mysql
- Host: GitHub
- URL: https://github.com/hennyfeliz/nodejs-express-mysql-api-rest
- Owner: hennyfeliz
- Created: 2022-08-31T02:37:43.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-12T21:50:24.000Z (over 2 years ago)
- Last Synced: 2025-01-27T10:43:41.546Z (4 months ago)
- Topics: apirest, database, expressjs, mysql, nodejs
- Language: JavaScript
- Homepage:
- Size: 34.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NodeJS Controller of housing and housing contracts API REST - MySQL, Express.
Simple Crud for managing and administering homes with a database and all the services of the CRUD concept.
You must make sure to create a database according to the models and controllers of the project, so that the edpoints return the correct content, you will find the queries to create the database in the root folder in a file called 'sql'.
* run the project: `npm run dev`
* Port: `http://localhost:8081`
* Don't forget to change the MySQL user settings in `./config/db.config.js`## Methods of use [you can use Postman to try it]
# * VIVIENDAS *
1. Create :
HTTP Method: POST.
```
POST - http:/localhost:8081/api/viviendas/
```2. Read :
HTTP Method: GET.
```
GET - http://localhost:8081/api/viviendas/
```HTTP Method: GET [for specific id].
```
GET - http://localhost:8081/api/viviendas/{id}
```3. Update :
HTTP Method: PUT.
```
PUT - http://localhost:8081/api/viviendas/{id}
```4. Delete :
HTTP Method: DELETE.
```
DELETE - http://localhost:8081/api/viviendas/{id}
```# * CONTRATOS *
1. Create :
HTTP Method: POST.
```
POST - http:/localhost:8081/api/contratos/
```2. Read :
HTTP Method: GET.
```
GET - http://localhost:8081/api/contratos/
```HTTP Method: GET [for specific id].
```
GET - http://localhost:8081/api/contratos/{id}
```3. Update :
HTTP Method: PUT.
```
PUT - http://localhost:8081/api/contratos/{id}
```4. Delete :
HTTP Method: DELETE.
```
DELETE - http://localhost:8081/api/contratos/{id}
```# * PROPIETARIOS *
1. Create :
HTTP Method: POST.
```
POST - http:/localhost:8081/api/propietarios/
```2. Read :
HTTP Method: GET.
```
GET - http://localhost:8081/api/propietarios/
```HTTP Method: GET [for specific id].
```
GET - http://localhost:8081/api/propietarios/{id}
```3. Update :
HTTP Method: PUT.
```
PUT - http://localhost:8081/api/propietarios/{id}
```4. Delete :
HTTP Method: DELETE.
```
DELETE - http://localhost:8081/api/propietarios/{id}
```
# * INQUILINOS *1. Create :
HTTP Method: POST.
```
POST - http:/localhost:8081/api/inquilinos/
```2. Read :
HTTP Method: GET.
```
GET - http://localhost:8081/api/inquilinos/
```HTTP Method: GET [for specific id].
```
GET - http://localhost:8081/api/inquilinos/{id}
```3. Update :
HTTP Method: PUT.
```
PUT - http://localhost:8081/api/inquilinos/{id}
```4. Delete :
HTTP Method: DELETE.
```
DELETE - http://localhost:8081/api/inquilinos/{id}