- Typescript v4.9.5
- MariaDB v10.5
copy .env.example and rename as .env
NODE_ENV=production
# local database
DB_HOST=
DB_PORT=
DB_USER=
DB_PASS=
DB_NAME=
# port
PORT =
# install dependencies
npm i
# run
npm start
# run test case
npm test
GET /getFee
curl --location 'localhost:8080/getFee?birthday=0520102&systemDate=2021-10-27'
HTTP/1.1 200 OK
Status: 200 OK
{"amount": 150}
POST /getPatient
curl --location 'localhost:8080/getPatient' \
--header 'Content-Type: application/json' \
--data '{"patientId":3, "systemDate":"2012-10-27"}'
HTTP/1.1 200 OK
Status: 200 OK
Content-Type: application/json
{
"patient": {
"id": 3,
"name": "莊小云",
"birth": "0771003",
"gender": "女",
"age": 24,
"nationality": "台灣"
},
"amount": 150
}