Skip to content

Commit

Permalink
update testc15.nim
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethosa committed Oct 26, 2024
1 parent 4bd026a commit 6d34b38
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions tests/testc15.nim
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@ mount Issue84:
serve "127.0.0.1", 5000:
mount "/issue84" -> Issue84

# on GET HTTP method at http://127.0.0.1:5000/
get "/":
{.gcsafe.}:
return %*{
"response": "success",
"msg": "These are not the droids, you're looking for."
}

post "/api/process[r:DataProcessRequest:json]":
{.gcsafe.}:
# Return plain text

# process data here

return %*{
"response": "success"
}

post "/urlencoded/[m:MyModel:urlencoded]":
echo m.x
return {"response": m.x}
Expand Down Expand Up @@ -74,7 +92,3 @@ serve "127.0.0.1", 5000:
get "/language/$lang?:enum(Language)":
## lang is lNim by default
return fmt"Hello from {lang}"

get "/language/[m:DataProcessRequest]":
## lang is lNim by default
return fmt"Hello from {m}"

0 comments on commit 6d34b38

Please sign in to comment.