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

allow forwarding jester.reusePort as not httpbeast.failOnExistingPort #281

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions jester.nim
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type
of RouteCode:
data: ResponseData

const jesterVer = "0.5.0"
const jesterVer = "0.5.1"

proc toStr(headers: Option[RawHeaders]): string =
return $newHttpHeaders(headers.get(@({:})))
Expand Down Expand Up @@ -499,10 +499,10 @@ proc serve*(
proc (req: httpbeast.Request): Future[void] =
{.gcsafe.}:
result = handleRequest(jes, req),
httpbeast.initSettings(self.settings.port, self.settings.bindAddr)
httpbeast.initSettings(self.settings.port, self.settings.bindAddr, failOnExistingPort = not self.settings.reusePort)
)
else:
self.httpServer = newAsyncHttpServer(reusePort=self.settings.reusePort)
self.httpServer = newAsyncHttpServer(reusePort = self.settings.reusePort)
let serveFut = self.httpServer.serve(
self.settings.port,
proc (req: asynchttpserver.Request): Future[void] {.gcsafe, closure.} =
Expand Down
4 changes: 2 additions & 2 deletions jester.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "0.5.0" # Be sure to update jester.jesterVer too!
version = "0.5.1" # Be sure to update jester.jesterVer too!
author = "Dominik Picheta"
description = "A sinatra-like web framework for Nim."
license = "MIT"
Expand All @@ -17,4 +17,4 @@ when not defined(windows):

task test, "Runs the test suite.":
exec "nimble install -y asynctools@#0e6bdc3ed5bae8c7cc9"
exec "nim c -r tests/tester"
exec "nim c -r tests/tester"