Skip to content

Commit

Permalink
Add notFound route handler to API
Browse files Browse the repository at this point in the history
  • Loading branch information
dvque committed Feb 3, 2024
1 parent a4480b6 commit 812f8c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Binary file modified bun.lockb
Binary file not shown.
4 changes: 4 additions & 0 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ app.get('/api/users/:userId', async (context) => {
return context.json(data)
})

app.use('*', async (c, next) => {
c.notFound()
})

export default {
port,
fetch: app.fetch, // Bun
Expand Down

0 comments on commit 812f8c8

Please sign in to comment.