@@ 99,7 99,6 @@ proc dispatchClient(s: Server, client: Socket) {.gcsafe.} =
proc dispatchClientPrecheck(s: Server, client: Socket) {.gcsafe.} =
## Handles exceptions from entire request/route/response
## dispatching process. Necessary for keep-alive.
-
try:
s.dispatchClient(client)
except:
@@ 9,13 9,15 @@ import silk/middleware/compression
import silk/middleware/logging
import silk/middleware/staticserve
-var sl = newServerLogger()
+var sl = newServerLogger(
+ @[newRollingFileLogger("test.log", maxLines = 20000).Logger],
+)
var serv = newServer(
ServerConfig(
host: "0.0.0.0",
port: Port(8080),
- workers: 6,
+ workers: 12,
serverLogger: sl,
),
middleware = @[
@@ 27,6 29,7 @@ var serv = newServer(
)
serv.GET("/", handler do: ctx.sendFile Path("./tests/index.html").string)
+serv.GET("/", "./tests/index.html")
serv.POST(
"/",
handler do: