This PR is mostly to gauge interest in a few changes I've made to a forked copy of this package. I can very easily split this up into many PRs if there is interest in any/all of this, but first wanted to see how it was received. Thanks for having a look!
Included Changes
Support Async/Await
a. Allows use of async/await to make async extremely simple
Fix file dir handling
a. Noticed files within directories were broken
Exclude DemoServer from package
a. Slim out the package
Add controller protocol and convenience subscript
a. Allows GET["your/route"] = MyController.myRouteHandler
i. The above would be possible for the following: struct MyController: Controller { func myRouteHandler(_ request: HttpRequest) async -> HttpResponse {
Enable registering multiple paths for a given handler
a. Allows GET["my/first/route", "my_other_route"] = { request in }
Trim : from request parameters
a. Allows request["parameterName"] vs request[":parameterName"] as a more convenient/intuitive accessor.
i. Addresses #489
Hi there 👋
This PR is mostly to gauge interest in a few changes I've made to a forked copy of this package. I can very easily split this up into many PRs if there is interest in any/all of this, but first wanted to see how it was received. Thanks for having a look!
Included Changes
GET["your/route"] = MyController.myRouteHandler
i. The above would be possible for the following:struct MyController: Controller { func myRouteHandler(_ request: HttpRequest) async -> HttpResponse {
GET["my/first/route", "my_other_route"] = { request in }
:
from request parameters a. Allowsrequest["parameterName"]
vsrequest[":parameterName"]
as a more convenient/intuitive accessor. i. Addresses #489