Skip to content

Commit 92e6536

Browse files
committed
fix: revert not found inside the routher
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
1 parent 770ccec commit 92e6536

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

backend/src/api/public/index.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
import { Router } from 'express'
22

3-
import { NotFoundError } from '@crowd/common'
4-
53
import { errorHandler } from './middlewares/errorHandler'
64
import { v1Router } from './v1'
75

86
export function publicRouter(): Router {
97
const router = Router()
108

119
router.use('/v1', v1Router())
12-
13-
router.use(() => {
14-
throw new NotFoundError()
15-
})
16-
1710
router.use(errorHandler)
1811

1912
return router

backend/src/api/public/v1/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Router } from 'express'
22

3+
import { NotFoundError } from '@crowd/common'
4+
35
import { AUTH0_CONFIG } from '../../../conf'
46
import { oauth2Middleware } from '../middlewares/oauth2Middleware'
57
import { staticApiKeyMiddleware } from '../middlewares/staticApiKeyMiddleware'
@@ -15,5 +17,9 @@ export function v1Router(): Router {
1517
router.use('/organizations', oauth2Middleware(AUTH0_CONFIG), organizationsRouter())
1618
router.use('/member-organization-affiliations', staticApiKeyMiddleware(), devStatsRouter())
1719

20+
router.use(() => {
21+
throw new NotFoundError()
22+
})
23+
1824
return router
1925
}

0 commit comments

Comments
 (0)