Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add router support #64

Merged
merged 5 commits into from
Mar 9, 2022
Merged

feat: add router support #64

merged 5 commits into from
Mar 9, 2022

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Mar 9, 2022

Exposing new createRouter utility using unjs/radix3 to create a router.

Usage:

import { createApp, createRouter } from 'h3'

const app = createApp()

const router = createRouter()
 .get('/', () => 'Hello World!')
 .get('/hello/:name', req => `Hello ${req.params.name}!`)

app.use(router)

When using two different methods on the same pattern.

This was referenced Mar 9, 2022
@pi0 pi0 merged commit 4035cca into main Mar 9, 2022
@pi0 pi0 deleted the feat/router branch March 9, 2022 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant