경로 대소문자 구분 설정 방법

Express에서는 caseSensitive라는 옵션을 통해서 백엔드로 들어오는 경로의 대소문자 구분 여부를 설정할 수 있습니다.

const router = express.Router({caseSensitive: true});
  • 옵션
    • caseSensitive

      • Type:Boolean
      • Default:false
      • Enable case sensitivity. Disabled by default, treating /Foo and /fooas the same.
    • mergeParams

      • Type:Boolean
      • Default:false
      • Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value takes precedence.
    • strict

      • Type:Boolean
      • Default:false
      • Enable strict routing. Disabled by default, /foo and /foo/ are treated the same by the router.