Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NestJS Debugger #229

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions Nest-js/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# compiled output
/dist
/node_modules

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
4 changes: 4 additions & 0 deletions Nest-js/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
73 changes: 73 additions & 0 deletions Nest-js/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/src/index.ts",
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"env": {
"NODE_ENV": "development"
}
},
{
"type": "node",
"request": "launch",
"name": "Launch in Docker",
"preLaunchTask": "tsc-watch",
"protocol": "auto",
"runtimeExecutable": "npm",
"runtimeArgs": [ "run", "docker-debug" ],
"port": 5858,
"restart": true,
"timeout": 60000,
"localRoot": "${workspaceFolder}/dist/src",
"remoteRoot": "/server/dist/src",
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"type": "node",
"request": "attach",
"name": "Attach to Docker",
"preLaunchTask": "tsc-watch",
"protocol": "auto",
"port": 5858,
"restart": true,
"sourceMaps": true,
"localRoot": "${workspaceFolder}/dist/src",
"remoteRoot": "/server/dist/src",
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"skipFiles": [
"<node_internals>/**/*.js",
]
},
{
"type": "node",
"request": "launch",
"name": "Local Nodemon",
"preLaunchTask": "tsc-watch",
"protocol": "auto",
"runtimeExecutable": "npm",
"runtimeArgs": [ "run", "debug" ],
"restart": true,
"port": 5858,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
]
}
]
}
7 changes: 7 additions & 0 deletions Nest-js/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.autoSave": "onFocusChange",
"editor.tabSize": 2,
"editor.detectIndentation": false,
"editor.insertSpaces": true
}
17 changes: 17 additions & 0 deletions Nest-js/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "tsc-watch",
"command": "npm",
"args": [ "run", "watch" ],
"type":"shell",
"isBackground": true,
"group":"build",
"problemMatcher": "$tsc-watch",
"presentation":{
"reveal": "always",
}
}
]
}
9 changes: 9 additions & 0 deletions Nest-js/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:8-slim

WORKDIR /server

COPY . /server
RUN npm install

EXPOSE 3000
CMD [ "npm", "start" ]
4 changes: 4 additions & 0 deletions Nest-js/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# NestJS
Debug NestJS with docker, nodemon and typescript watch.

Oficial website: https://nestjs.com/
11 changes: 11 additions & 0 deletions Nest-js/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "2"

services:
nestjs:
build: .
command: npm run debug
volumes:
- ./dist:/server/dist
ports:
- "3000:3000"
- "5858:5858"
5 changes: 5 additions & 0 deletions Nest-js/nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"language": "ts",
"collection": "@nestjs/schematics",
"sourceRoot": "src"
}
Loading