- Node
- MySQL
- Npm
- Typescript
- Express
- Prisma
- MySQL
# see .env.sample
DATABASE_URL=mysql://username:password@localhost:3306/DATABASE_NAME
yarn install
# or
npm install
yarn watch
# or
npm run watch
yarn build
# or
npm run build
# and then
yarn production
# or
npm run production
You can import postman/Test_CRUD.postman_collection.json
into your postman client
List all customers
endpoint: /api/customer
method: GET
List customer by id
endpoint: /api/customer/:id
method: GET
Create customer
endpoint: /api/customer
method: POST
payload:
{
name: String;
email: String;
phone: String;
}
Update customer
endpoint: /api/customer/:id
method: PUT
payload:
{
name: String;
email: String;
phone: String;
}
Delete customer
endpoint: /api/customer/:id
method: DELETE
List all address
endpoint: /api/address
method: GET
List address by id
endpoint: /api/address/:id
method: GET
Create address
endpoint: /api/address
method: POST
payload:
{
zip: Number;
city: String;
province: String;
house: String;
customerId: Number
}
Update address
endpoint: /api/address/:id
method: PUT
payload:
{
zip: Number;
city: String;
province: String;
house: String;
}
Delete address
endpoint: /api/address/:id
method: DELETE