Files
infisical/docs/integrations/frameworks/nestjs.mdx

48 lines
1.1 KiB
Plaintext

---
title: "NestJS"
---
Prerequisite: [Install the CLI](/cli/overview)
## Initialize Infisical for your [NestJS](https://nestjs.com) app
```bash
# move to your Next.js app
cd /path/to/project
# initialize infisical
infisical init
```
## Modify the start script in your `package.json`
```json
...
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "infisical run -- nest start",
"start:dev": "infisical run -- nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
}
...
```
## Start your server with environment variables injected
```bash
npm run start
# or start development server
npm run start:dev
```