https://github.com/cuongndc9/express-mysql-restful
💉 Build a RESTful API using Express and MySQL.
https://github.com/cuongndc9/express-mysql-restful
103cuong express expressjs mysql rest rest-api restful-api
Last synced: 11 months ago
JSON representation
💉 Build a RESTful API using Express and MySQL.
- Host: GitHub
- URL: https://github.com/cuongndc9/express-mysql-restful
- Owner: cuongndc9
- License: mit
- Created: 2019-02-16T07:51:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-03-07T19:24:57.000Z (over 1 year ago)
- Last Synced: 2025-03-07T20:26:08.384Z (over 1 year ago)
- Topics: 103cuong, express, expressjs, mysql, rest, rest-api, restful-api
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# express-mysql-restful
> 💉 Build a RESTful API using Express and MySQL.
## Install
Install dependencies
```
$ npm i
```
Create `.env` file
```
PORT=
DB_HOST=
DB_USER=
DB_PASSWORD=
DB_DATABASE=
```
## Usage
One line to run
```
$ npm start
```
## API
| Route | HTTP method | Description |
|------------------|-------------|-----------------------------|
| /api/cats | `GET` | Get all the cats. |
| /api/cats | `POST` | Create a cat. |
| /api/cats/:catId | `GET` | Get a single cat. |
| /api/cats/:catId | `PUT` | Update a cat with new info. |
| /api/cats/:catId | `DELETE` | Delete a cat. |
## License

> "Don't let yesterday take up too much of today." - Will Rogers