A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript starter repository.
$ yarn install
# development
$ yarn run start
# watch mode
$ yarn run start:dev
# production mode
$ yarn run start:prod
# unit tests
$ yarn run test
# e2e tests
$ yarn run test:e2e
# test coverage
$ yarn run test:cov
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - Kamil Myśliwiec
- Website - https://nestjs.com
- Twitter - @nestframework
Nest is MIT licensed.
The Rest api to the blog api is described below,
- POST /user
curl --location 'http://localhost:3000/user' \
--header 'x-api-key: live_sk_65ab9353145cab9557ab93df95e31d62629c343' \
--header 'app-id: 9a2f92ad-3613-4074-9027-3b63de7149d8' \
--header 'Content-Type: application/json' \
--data-raw '{
"user": {
"username": "AKintunde Bello",
"email": "AkinsTheMan@gmail.com",
"password": "AkinsTheMan@123454"
}
}'
{
"user": {
"username": "AKintunde Bello",
"email": "AkinsTheMan@gmail.com",
"id": 14,
"bio": "",
"image": "",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQsImVtYWlsIjoiQWtpbnNUaGVNYW5AZ21haWwuY29tIiwidXNlcm5hbWUiOiJBS2ludHVuZGUgQmVsbG8iLCJpYXQiOjE3MTQ2OTM4MjEsImV4cCI6MTcxNDY5NDcyMX0.KwBXTmZJLOjArYg09c7ARd-reXkJtKJqzeoH3smlweM"
}
}
- POST /user/login
curl --location 'http://localhost:3000/user/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"user": {
"email": "AkinsTheMan@gmail.com",
"password": "AkinsTheMan@123454"
}
}'
{
"user": {
"id": 14,
"username": "AKintunde Bello",
"email": "AkinsTheMan@gmail.com",
"bio": "",
"image": "",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQsImVtYWlsIjoiQWtpbnNUaGVNYW5AZ21haWwuY29tIiwidXNlcm5hbWUiOiJBS2ludHVuZGUgQmVsbG8iLCJpYXQiOjE3MTQ2OTQxMDMsImV4cCI6MTcxNDY5NTAwM30.UNYYq8FXiSepeHUFHlHat8_PnTdXi8yqxEeLKtXBTPo"
}
}
curl --location --request PUT 'http://localhost:3000/user' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQsImVtYWlsIjoiQWtpbnNUaGVNYW5AZ21haWwuY29tIiwidXNlcm5hbWUiOiJBS2ludHVuZGUgQmVsbG8iLCJpYXQiOjE3MTQ2OTQxMDMsImV4cCI6MTcxNDY5NTAwM30.UNYYq8FXiSepeHUFHlHat8_PnTdXi8yqxEeLKtXBTPo' \
--data '{
"user": {
"bio": "Some bio",
"image": "https://i.stack.imgur.com/xHWG8jpg"
}
}'
{
"user": {
"id": 14,
"username": "AKintunde Bello",
"email": "AkinsTheMan@gmail.com",
"bio": "Some bio",
"image": "https://i.stack.imgur.com/xHWG8jpg"
}
}
curl --location 'http://localhost:3000/user' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTQsImVtYWlsIjoiQWtpbnNUaGVNYW5AZ21haWwuY29tIiwidXNlcm5hbWUiOiJBS2ludHVuZGUgQmVsbG8iLCJpYXQiOjE3MTQ2OTQxMDMsImV4cCI6MTcxNDY5NTAwM30.UNYYq8FXiSepeHUFHlHat8_PnTdXi8yqxEeLKtXBTPo'
{
"user": {
"id": 14,
"username": "AKintunde Bello",
"email": "AkinsTheMan@gmail.com",
"bio": "Some bio",
"image": "https://i.stack.imgur.com/xHWG8jpg"
}
}
curl --location 'http://localhost:3000/articles' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MiwiZW1haWwiOiJoYXJ3YXJsODdAZ21haWwuY29tIiwidXNlcm5hbWUiOiJkb2t1biIsImlhdCI6MTcxNDY3MTEyNSwiZXhwIjoxNzE0NjcyMDI1fQ.JMbPPRm6XUj1NutlNUAUgghx0711L4GUXTK1Rpv6hkU' \
--data '{
"article": {
"title": "This is my first article",
"description": "This is my description",
"body": "This is the body",
"tagList": ["This is it"]
}
}'
curl --location 'http://localhost:3000/articles/this-is-my-first-article--685hbx.w89l7' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MiwiZW1haWwiOiJoYXJ3YXJsODdAZ21haWwuY29tIiwidXNlcm5hbWUiOiJkb2t1biIsImlhdCI6MTcxNDY3MTEyNSwiZXhwIjoxNzE0NjcyMDI1fQ.JMbPPRm6XUj1NutlNUAUgghx0711L4GUXTK1Rpv6hkU'
curl --location 'http://localhost:3000/articles/this-is-my-first-article--685hbx.w89l7' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MiwiZW1haWwiOiJoYXJ3YXJsODdAZ21haWwuY29tIiwidXNlcm5hbWUiOiJkb2t1biIsImlhdCI6MTcxNDY3MTEyNSwiZXhwIjoxNzE0NjcyMDI1fQ.JMbPPRm6XUj1NutlNUAUgghx0711L4GUXTK1Rpv6hkU'