Skip to content

Commit

Permalink
fix bug (HapticX/happyx#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethosa committed Jul 25, 2023
1 parent 91224af commit a42b940
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions simple_rest_api/src/mounts/posts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ model AddPost:

mount Posts:
# on GET HTTP method at 127.0.0.1:5000/posts
get "/":
"/":
# will responds all posts
return posts

# on GET HTTP method at 127.0.0.1:5000/post
get "/$index:int": # index is post index
"/$index:int": # index is post index
if posts.len > index:
# try open 127.0.0.1:5000/post0
return posts[index]
Expand Down

0 comments on commit a42b940

Please sign in to comment.