-
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
7,843 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# NestJS Example | ||
|
||
This example demonstrates how to use `express-openapi-validator` with [NestJS](https://nestjs.com/). | ||
|
||
## Install | ||
|
||
From this `9-nestjs` directory, run: | ||
|
||
```shell | ||
npm ci | ||
``` | ||
|
||
## Run | ||
|
||
### Start Server | ||
|
||
#### Watch Mode | ||
|
||
```shell | ||
npm run start | ||
``` | ||
|
||
or | ||
|
||
```shell | ||
npm run start:dev | ||
``` | ||
|
||
#### Production Mode | ||
|
||
```shell | ||
npm run build | ||
npm run start:prod | ||
``` | ||
|
||
### Requests | ||
|
||
```shell | ||
curl --request GET --url http://localhost:3000/ping/foo | ||
``` | ||
|
||
```shell | ||
curl --request POST \ | ||
--url http://localhost:3000/ping \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{"ping": "GNU Terry Pratchett"}' | ||
``` | ||
|
||
## Tests | ||
|
||
```shell | ||
npm run test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { Config } from '@jest/types'; | ||
|
||
const config: Config.InitialOptions = { | ||
moduleFileExtensions: ['ts', 'js'], | ||
testMatch: ['**/*.spec.ts'], | ||
transform: { | ||
'\\.ts': 'ts-jest', | ||
}, | ||
|
||
testEnvironment: 'node', | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"sourceRoot": "src", | ||
"compilerOptions": { | ||
"deleteOutDir": false, | ||
"tsConfigPath": "tsconfig.json" | ||
} | ||
} |
Oops, something went wrong.