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

RouteBuilder not found #3

Closed
waghanza opened this issue Sep 22, 2024 · 4 comments
Closed

RouteBuilder not found #3

waghanza opened this issue Sep 22, 2024 · 4 comments

Comments

@waghanza
Copy link

Hi @ragokan,

In the-benchmarker/web-frameworks#7753, you changed the implementation for bunicorn, but running the results for monday, I have

Bun v1.1.29 (Linux arm64)
1 | (function (entry, fetcher)
    ^
SyntaxError: Export named 'RouteBuilder' not found in module '/root/.bun/install/cache/@bunicorn/server@0.0.27@@@1/dist/index.js'.

Regards,

@ragokan
Copy link
Owner

ragokan commented Sep 22, 2024

Hello @waghanza

Thanks, sorry for the issue, it is renamed to "Router", I will create a pull request for that.
I didn't thought that it would update to the latest version

Have a great day!

@waghanza
Copy link
Author

No need @ragokan, I'll update code base myself ;-)

Results will be up tomorrow

@ragokan
Copy link
Owner

ragokan commented Sep 22, 2024

Thanks a lot, I still wanted to provide the updated usage.

import { Router, BunicornApp } from "@bunicorn/server";

const app = new BunicornApp();
const router = new Router();
app.addRoutes([
  router.get("/", (ctx) => ctx.ok()),
  router.get("/user/:id", (ctx) => ctx.raw(ctx.params.id)),
  router.post("/user", (ctx) => ctx.ok()),
]);

app.serve({
  port: 3000,
	reusePort: true
})

@waghanza
Copy link
Author

Will update 🎉

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

No branches or pull requests

2 participants