https://github.com/winverse/express-rest-api-sample
Express-rest-api-sample
https://github.com/winverse/express-rest-api-sample
express rest-api
Last synced: about 1 year ago
JSON representation
Express-rest-api-sample
- Host: GitHub
- URL: https://github.com/winverse/express-rest-api-sample
- Owner: winverse
- License: mit
- Created: 2021-03-06T08:59:13.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-08-09T01:29:43.000Z (almost 4 years ago)
- Last Synced: 2025-03-28T10:54:06.523Z (over 1 year ago)
- Topics: express, rest-api
- Language: JavaScript
- Homepage:
- Size: 57.6 KB
- Stars: 1
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Express-rest-api-sample
NodeJS REST API sample with integration Express, Sequelize
## Configure Environment Variables
Open .env.sample file and edit the values and then
change file name .env.development or .env.production depending on your environment if you need to.
This project uses [dotenv](https://www.npmjs.com/package/dotenv) to read and use .env file
- Modular Routes
- Database integration using [Sequelize V6](https://sequelize.org/master/)
- JWT Token based Authentication
- Implementing File Uploads by [multer](https://www.npmjs.com/package/multer)
- [Supported REST API Doc](https://documenter.getpostman.com/view/4627621/Tz5jfft1) (Postman)
## Project Start
This project requires Node 14 or later.
```javascript
1. yarn // install dependencies
2. yarn dev // run server
```
### Migration Skeleton
Create migration file using sequelize cli
```javascript
npx sequelize-cli migration:generate --name
```
### Running migrations
```javascript
yarn db:migrate
```
### Sync database
```javascript
yarn db:sync
```
### Test
To run test, install jest
```javascript
yarn test
```