Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/husainrizaldy/simple-express-api
practice with node-js
https://github.com/husainrizaldy/simple-express-api
express-js node-js sequelize-migrations sequelize-orm sequelize-seeder
Last synced: about 1 month ago
JSON representation
practice with node-js
- Host: GitHub
- URL: https://github.com/husainrizaldy/simple-express-api
- Owner: husainrizaldy
- Created: 2024-09-08T16:53:04.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-09T08:42:35.000Z (4 months ago)
- Last Synced: 2024-10-13T03:20:51.005Z (2 months ago)
- Topics: express-js, node-js, sequelize-migrations, sequelize-orm, sequelize-seeder
- Language: JavaScript
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# Simple CRUD using Node.js
## Dependencies
- `body-parser`
- `dotenv`
- `express`
- `express-validator`
- `joi`
- `mysql2`
- `nodemon`
- `sequelize`
- `sequelize-cli`## Instalasi
**Clone repository**
```
git clone https://github.com/husainrizaldy/simple-express-api
cd simple-express-api
```
**Install dependencies**
```
npm install
```
**Config .env file**Create a .env file in the root of your project and add the following :
```
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=yourPassword
DB_NAME=yourDbName
DB_PORT=3306
DB_DIALECT='mysql'
```
You can use `.env.example` as a reference for the required environment variables.**Run migrations and seeders**
Ensure that you have created a database in your MySQL server.
```
npm run db:migrate
npm run db:seed
```**Run the application**
```
npm run api-service
```