Skip to content

This is a simple API like a "jsonPlaceholder" but it is based on the nest js framework

Notifications You must be signed in to change notification settings

ZeraiGR/json-placeholder-nest-parody

Repository files navigation

Json-placeholder-nest-parody

This is a simple API like a JSON Placeholder but it is based on the nest js framework

Available routes

For user

  GET:    /users
  GET:    /users/:id
  GET:    /users/:id/posts
  GET:    /users/:id/todos
  GET:    /users/:id/albums
  POST:   /users
  PUT:    /users/:id
  PATCH:  /users/:id
  DELETE: /users/:id

For post

  GET:    /posts?userId=userId
  GET:    /posts/:id
  GET:    /posts/:id/comments
  POST:   /posts
  PUT:    /posts/:id
  PATCH:  /posts/:id
  DELETE: /posts/:id

For comment

  GET:    /comments?postId=postId
  GET:    /comments/:id
  POST:   /comments
  PUT:    /comments/:id
  PATCH:  /comments/:id
  DELETE: /comments/:id

For todo

  GET:    /todos?userId=userId
  GET:    /todos/:id
  POST:   /todos
  PUT:    /todos/:id
  PATCH:  /todos/:id
  DELETE: /todos/:id

For album

  GET:    /albums?userId=userId
  GET:    /albums/:id
  GET:    /albums/:id/photos
  POST:   /albums
  PUT:    /albums/:id
  PATCH:  /albums/:id
  DELETE: /albums/:id

For photo

  GET:    /photos?albumId=albumId
  GET:    /photos/:id
  POST:   /photos
  PUT:    /photos/:id
  PATCH:  /photos/:id
  DELETE: /photos/:id

Installation

For correct working it needs to be worked mongodb on url: mongodb://127.0.0.1:27017/sandbox by default you can change it if you want Mongodb can be installed locally on your computer:

or it can be installed inside docker container:

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Support

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.

Stay in touch

License

Nest is MIT licensed.

About

This is a simple API like a "jsonPlaceholder" but it is based on the nest js framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published