This is Rest API for service that named "Gaeddal" of Team DDD.
This api service architecture is Node.js, Express.js, MySQL and es6.
- Node.JS : https://nodejs.org/en/download/
- MySQL : https://dev.mysql.com/downloads/
- Docker-for-mac : https://docs.docker.com/docker-for-mac/install/
- Docker-for-Window : https://docs.docker.com/docker-for-windows/install/
git clone https://github.com/BBackJK/gaeddal_api.git
cd gaeddal_api/
npm install
If your local dont't have mysql, start mysql container.
// mysql container in local
docker run -d -p 3306:3306 --name database \
-e MYSQL_ROOT_PASSWORD=test \
-e MYSQL_DATABASE=gaeddal \
-e MYSQL_HOST=localhost \
-v ~/database/gaeddal:/var/lib/mysql mysql:5.7
// check container
docker ps -a
// start project
npm start
Setting your mysql CREATE DATABASE gaeddal
start this project on local.
npm start
in gaeddal_api folder..
// run mysql container
docker run -d -p 3306:3306 --name database \
-e MYSQL_ROOT_PASSWORD=test \
-e MYSQL_DATABASE=gaeddal \
-e MYSQL_HOST=database \
-v ~/database/gaeddal:/var/lib/mysql mysql:5.7
// build project with docker
docker build -t gaeddal-api .
// check images
docker images
// run api container
docker run -d -p 8000:8000 --name api \
--link database \
-e MYSQL_ROOT_PASSWORD=test \
-e MYSQL_DATABASE=gaeddal \
-e MYSQL_HOST=database \
gaeddal-api
// check container
docker ps -a
// build project with docker
docker build -t gaeddal-api .
// start docker compose
docker-compose up -d
// check container
docker ps -a
// stop container
docker-compose down
npm run lint // check eslint
npm run trans // transpile babel file
it you want to know the api of this project, you connect http://localhost:8000/docs