-
Notifications
You must be signed in to change notification settings - Fork 374
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
Adding Routes#serve
Method
#2801
Labels
enhancement
New feature or request
Comments
Hello, you can do it like so implicit class RouteOps[Env, Err <: Response](val routes: Routes[Env, Err]) extends AnyVal {
def serve: URIO[Env with Server, Int] = Server.install(routes)
}
def run =
Routes {
Method.GET / "hello" -> handler(Response.text("Hello, World!"))
}
.serve
.provide(Server.default) |
@GrigoriiBerezin I think the point of this ticket is to streamline this for users so they don't have to write boilerplate code :) |
Ok, I see, may create a MR for that 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would like to have a simple API with the following syntax:
The text was updated successfully, but these errors were encountered: