- Install TypeScript global
npm i -g typescript
- Install dependencies:
yarn install
ounpm install
- TypeScript compile:
yarn compile
ounpm run compile
- Start application:
yarn dev
ounpm run dev
.
- Request findAll Users:
application.get("/users");
[
{
id: 1,
name: "Caio Agiani",
email: "caio.agiani14@gmail.com",
},
{
id: 2,
name: "Caio Henrique",
email: "agianicaio@gmail.com",
},
];
- Request findById User:
application.get("/users/:id");
{
"id": 1,
"name": "Caio Agiani",
"email": "caio.agiani14@gmail.com"
}
- Request Create User:
application.post("/users");
{
"name": "Caio Agiani",
"email": "caio.agiani14@gmail.com",
"password": "123"
}