죠니의 개발일기

  • 홈
  • 태그
  • 방명록

Express 2

Express 4.x에서 express-async-errors로 Rejected Promise 처리하기

Bun, Express, TypeScript 환경에서 API를 개발할 때, 요청 헤더의 범위 설정이 잘못되어 오류가 발생할 수 있습니다. 이 경우 416 상태 코드 응답이 반환됩니다. 에러 핸들링 미들웨어를 사용해도 에러를 잡지 못하는 상황이 발생할 수 있는데 그 이유와 해결 방법을 알아보았습니다.문제: Express 4.x에서 Rejected Promise문제의 핵심은 Express 4.x가 미들웨어나 에러 핸들러를 통해 rejected promises를 처리하지 않는다는 점입니다. 즉, 함수가 rejected promise를 반환할 때 미들웨어가 이를 잡지 못합니다. 대신, 이를 명시적으로 catch 블록을 사용하여 처리해야 하지만, 이는 코드를 더욱 더럽게..(?) 만듭니다.예시const rejec..

에러노트 2024.06.25

[번역] NodeJS 보안 사항 및 시큐어 코딩 BY OWASP

NodeJS Security Cheat Sheet NodeJS 보안 치트 시트원본: https://cheatsheetseries.owasp.org/cheatsheets/Nodejs_Security_Cheat_Sheet.html#nodejs-security-cheat-sheet Nodejs Security - OWASP Cheat Sheet SeriesNodeJS Security Cheat Sheet Introduction This cheat sheet lists actions developers can take to develop secure Node.js applications. Each item has a brief explanation and solution that is specific to th..

보안 2024.06.04
이전
1
다음
더보기
반응형
프로필사진

죠니의 개발일기

죠니의 기술 블로그 입니다.

  • 분류 전체보기 N
    • PowerShell
    • 에러노트
    • Library
    • 네트워크
    • 서버
      • Bun
      • Node.js
      • Express
    • 보안
    • Language
      • Typescript
    • Linux
    • AWS
    • Git
    • DB
      • MongoDB
    • docker

Tag

Express, cifs, 이벤트 루프, PowerShell, zod, Let's Encrypt, 유효성 검사, 네트워크 설정, 세션 관리, 비동기 프로그래밍, 타입스크립트, 파일 공유, podman, bun, 로드 밸런싱, ubuntu, https, pm2, node.js, 클러스터링,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/12   »
일 월 화 수 목 금 토
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31

방문자수Total

  • Today :
  • Yesterday :
Github

Copyright © Kakao Corp. All rights reserved.

티스토리툴바