nksaraf / vinxi

The Full Stack JavaScript SDK
https://vinxi.vercel.app
MIT License
2.19k stars 80 forks source link

Re-export useBase from H3 #371

Closed jakst closed 2 months ago

jakst commented 2 months ago

useBase is a useful H3 utility for creating nested routers. Having it available directly from Vinxi would be useful.

https://h3.unjs.io/guide/router#nested-routers

You can nest routers to create a tree of routers. This is useful to split your application into multiple parts like the API and the website.

websiteRouter.use("/api/**", useBase("/api", apiRouter.handler));
codesandbox[bot] commented 2 months ago

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: af8381df6cdb0d9e8b90dd54d902576137bed890

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ------------- | ----- | | vinxi | Patch | | @vinxi/router | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 2 months ago

@jakst is attempting to deploy a commit to the Nikhil Saraf's projects Team on Vercel.

A member of the Team first needs to authorize it.

pkg-pr-new[bot] commented 2 months ago

Open in Stackblitz

@vinxi/deno-doc

``` pnpm add https://pkg.pr.new/@vinxi/deno-doc@371 ```

vinxi

``` pnpm add https://pkg.pr.new/vinxi@371 ```

@vinxi/plugin-directives

``` pnpm add https://pkg.pr.new/@vinxi/plugin-directives@371 ```

@vinxi/doc

``` pnpm add https://pkg.pr.new/@vinxi/doc@371 ```

@vinxi/openapi

``` pnpm add https://pkg.pr.new/@vinxi/openapi@371 ```

@vinxi/plugin-mdx

``` pnpm add https://pkg.pr.new/@vinxi/plugin-mdx@371 ```

@vinxi/react

``` pnpm add https://pkg.pr.new/@vinxi/react@371 ```

@vinxi/react-server

``` pnpm add https://pkg.pr.new/@vinxi/react-server@371 ```

@vinxi/router

``` pnpm add https://pkg.pr.new/@vinxi/router@371 ```

@vinxi/server-components

``` pnpm add https://pkg.pr.new/@vinxi/server-components@371 ```

@vinxi/server-functions

``` pnpm add https://pkg.pr.new/@vinxi/server-functions@371 ```

@vinxi/solid

``` pnpm add https://pkg.pr.new/@vinxi/solid@371 ```

commit: af8381d