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

Add support for modern web frameworks like Hono or Oak #452

Open
nikrooz opened this issue Oct 24, 2024 · 0 comments
Open

Add support for modern web frameworks like Hono or Oak #452

nikrooz opened this issue Oct 24, 2024 · 0 comments

Comments

@nikrooz
Copy link

nikrooz commented Oct 24, 2024

With modern JavaScript runtimes that follow web standards, we now have frameworks like Hono and Oak that let you write code without worrying about where it will run.

It would be good to simplify the integration of Restate with these frameworks, maybe by introducing something like

const app = new Hono()
const greeter = service({
  name: "Greeter",
  handlers: {
    greet: async (ctx: Context, greeting: string) => {
      return `${greeting}!`;
    },
  },
});

app.use('*', someRestateMiddleware(greeter))
app.get('/some-user-facing-path', (c) => {
  return c.text('Hello Hono!')
})

Deno.serve(app.fetch);
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

1 participant