h3
h3 and Nitro routes in the sidebar.
Code routes come from router.get, post, put, patch, delete, head, options, all, and use. File routes come from server/api and server/routes:
server/api/hello.ts is GET /api/hello
server/api/hello.get.ts is GET /api/hello
server/api/users/[id].get.ts is GET /api/users/:id
server/api/[...slug].ts is GET /api/:slug
server/api/index.ts is GET /api
server/routes/hello.ts is GET /hello
The same method and path in two places is a warning.
What you get
- Sidebar of routes
- Method and path above each route
- Warning on a duplicate method and path
The sidebar stays empty until the workspace depends on h3, nitropack, or nuxt.
Settings
| Setting |
Default |
What it does |
h3.codeLens |
on |
Method and path above a route |
h3.diagnostics |
on |
Warn when a method and path is defined twice |
Commands
- h3: Refresh reads the workspace again
- h3: Focus Routes opens the sidebar
| |