- 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: "[email protected]",
},
{
id: 2,
name: "Caio Henrique",
email: "[email protected]",
},
];
- Request findById User:
application.get("/users/:id");
{
"id": 1,
"name": "Caio Agiani",
"email": "[email protected]"
}
- Request Create User:
application.post("/users");
{
"name": "Caio Agiani",
"email": "[email protected]",
"password": "123"
}