English | 한국어
- Dokerized Express + Typescript app with MySQL Database
- Code Hot reloading While running Docker Container
- Minimal Memo API server example
- Clone this repository
- Rename
.env.example
to.env
- Run the command
docker-compose up
View logs
docker-compose logs app
docker-compose logs db
Open mysql terminal
docker exec -it db bin/sh
mysql -u root -p
Stops containers and removes containers, networks, volumes, and images created by up
docker-compose down
Build images before starting containers
docker-compose up --build
├── public/ # README logo
├── src/ # main source code
│ ├── interfaces # typescript interfaces
│ ├── database.ts # database connection and sql query
│ ├── app.ts # express application
│ └── server.ts # start server
├── requests.rest # requests file to test docker-compose
├── my.cnf # mysql configuration
├── setup.sql # database info configuration
├── start.sh # start script for express app
├── Dockerfile.dev # dockerfile for express app
├── docker-compose.yml # docker-compose configuration
├── .env.example # env variable configuration
├── package-lock.json # package-lock.json
├── package.json # package.json
└── tsconfig.json # typescript config
Using REST Client or Whatever you want, like Postman
GET http://localhost:3000/api/memo
###
POST http://localhost:3000/api/memo
content-type: application/json
{
"content": "default memo"
}
###
PUT http://localhost:3000/api/memo
content-type: application/json
{
"id" : 1,
"newContent" : "modified memo"
}
###
DELETE http://localhost:3000/api/memo
content-type: application/json
{
"id" : "1"
}