Skip to content

Latest commit

History

History
62 lines (43 loc) 路 834 Bytes

File metadata and controls

62 lines (43 loc) 路 834 Bytes

NestJS Example

This example demonstrates how to use express-openapi-validator with NestJS.

Install

From this 9-nestjs directory, run:

npm ci

Run

Start Server

Watch Mode

npm run start

or

npm run start:dev

Production Mode

npm run build
npm run start:prod

Requests

curl --request GET --url http://localhost:3000/ping/foo
curl --request POST \
  --url http://localhost:3000/ping \
  --header 'Content-Type: application/json' \
  --data '{"ping": "GNU Terry Pratchett"}'

validation error

curl --request POST \
  --url http://localhost:3000/ping \
  --header 'Content-Type: application/json' \
  --data '{"pingoo": "GNU Terry Pratchett"}'|jq

Tests

npm run test