Skip to content

Commit

Permalink
Feat/sentry 에러 처리 했당 (#31)
Browse files Browse the repository at this point in the history
* Feat: Add sentry

* Docs: Add sentry url

* Feat: discord webhook catch완료

* Feat: dev 아닐 때만catch 할 수 있도록

* Feat: Get constant to be in service

* Refactor: Change util to search

* Refactor: Change env types

* Resolve: conflicts

* Fix: pnpm lock
  • Loading branch information
Ho-s authored Jun 29, 2024
1 parent b83ae18 commit fa367df
Show file tree
Hide file tree
Showing 18 changed files with 1,126 additions and 55 deletions.
3 changes: 3 additions & 0 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ DB_NAME=postgres
DB_PASSWORD=1q2w3e4r
DB_PORT=5432


# kakao
KAKAO_CLIENT_ID=
KAKAO_REDIRECT_URL=
Expand All @@ -16,6 +17,8 @@ PORT=8000

TEST_USER_ID=

DISCORD_WEBHOOK_URL=

JWT_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----"
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ lerna-debug.log*

.env
*.env
!.example.env
!.example.env
# Sentry Config File
.sentryclirc
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ $ pnpm migrate:up:dev
$ pnpm start:dev
```

## Error catch

### [sentry url](https://vitaminc.sentry.io/projects/node-nestjs/?project=4507516570697728)

## Todo
2 changes: 2 additions & 0 deletions additional.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ declare namespace NodeJS {
CLIENT_URL: string;
GPT_KEY: string;

DISCORD_WEBHOOK_URL: string;

// for test
TEST_USER_ID?: number;
}
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "commonjs",
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"build": "nest build && pnpm sentry:sourcemaps",
"migrate:create:dev": "dotenv -e .development.env -- npx mikro-orm migration:create",
"migrate:up:dev": "dotenv -e .development.env -- npx mikro-orm migration:up",
"show:database:schema": "dotenv -e .development.env -- npx mikro-orm schema:create --dump",
Expand All @@ -29,7 +29,8 @@
"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",
"prepare": "husky",
"postgres:local:up": "docker compose --env-file .development.env up -d && pnpm migrate:up:dev"
"postgres:local:up": "docker compose --env-file .development.env up -d && pnpm migrate:up:dev",
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org vitaminc --project node-nestjs ./dist && sentry-cli sourcemaps upload --org vitaminc --project node-nestjs ./dist"
},
"dependencies": {
"@mikro-orm/core": "^6.2.9",
Expand All @@ -46,6 +47,8 @@
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-express": "^10.3.9",
"@nestjs/swagger": "^7.3.1",
"@sentry/cli": "^2.32.1",
"@sentry/nestjs": "^8.13.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"cookie-parser": "^1.4.6",
Expand All @@ -66,6 +69,8 @@
"@nestjs/cli": "^10.3.2",
"@nestjs/schematics": "^10.1.1",
"@nestjs/testing": "^10.3.9",
"@sentry/node": "^8.13.0",
"@sentry/profiling-node": "^8.13.0",
"@swc/cli": "^0.3.12",
"@swc/core": "^1.6.1",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
Expand Down
Loading

0 comments on commit fa367df

Please sign in to comment.