Skip to content

Commit

Permalink
Merge pull request HapticX#356 from HapticX/dev
Browse files Browse the repository at this point in the history
add built-in server based on httpx
  • Loading branch information
Ethosa authored Oct 5, 2024
2 parents 689e3e4 + 5fd9370 commit e9314bb
Show file tree
Hide file tree
Showing 8 changed files with 877 additions and 30 deletions.
4 changes: 3 additions & 1 deletion src/happyx/core/constants.nim
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@
# Configuration via `-d`/`--define`
const
# Alternative HTTP Servers
enableHttpx* = defined(httpx) or defined(happyxHttpx) or defined(hpxHttpx)
enableMicro* = defined(micro) or defined(happyxMicro) or defined(hpxMicro)
enableStd* = defined(stdserver) or defined(happyxStdserver) or defined(hpxStdserver)
enableHttpx* = defined(httpx) or defined(happyxHttpx) or defined(hpxHttpx)
enableHttpBeast* = defined(beast) or defined(happyxBeast) or defined(hpxBeast)
enableBuiltin* = int(enableMicro) + int(enableStd) + int(enableHttpx) + int(enableHttpBeast) == 0
# LiveViews
enableLiveViews* = not (defined(noLiveviews) or defined(hpxNoLiveviews) or defined(happyxNoLiveviews))
# Safe Requests
Expand Down
2 changes: 1 addition & 1 deletion src/happyx/routing/routing.nim
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ proc exportRouteArgs*(urlPath, routePath, body: NimNode): NimNode =
elifBranch.add(body)

let reqBody =
when enableHttpBeast or enableHttpx:
when enableHttpBeast or enableHttpx or enableBuiltin:
newCall("get", newDotExpr(ident"req", ident"body"))
else:
newDotExpr(ident"req", ident"body")
Expand Down
Loading

0 comments on commit e9314bb

Please sign in to comment.