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

make initServer and serve macros #10

Closed
Ethosa opened this issue Apr 7, 2023 · 0 comments
Closed

make initServer and serve macros #10

Ethosa opened this issue Apr 7, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Ethosa
Copy link
Contributor

Ethosa commented Apr 7, 2023

Simple syntax:

initServer:
  var server = newServer()
  server.routes:
    "/":
      req.answer "Hi"
  server.start()
serve("127.0.0.1", 5000):
  "/":
    req.answer "Hi"

It's will be nice shortcut for

proc main() =
  var server = newServer()
  server.routes:
    "/":
      req.answer "Hi"
  server.start()
main()
@Ethosa Ethosa added the enhancement New feature or request label Apr 7, 2023
@Ethosa Ethosa self-assigned this Apr 7, 2023
Ethosa added a commit that referenced this issue Apr 7, 2023
@Ethosa Ethosa closed this as completed Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant