jester icon indicating copy to clipboard operation
jester copied to clipboard

Missing documentation

Open mildred opened this issue 5 years ago • 2 comments

There is very little information about how jester works, in particular how route patterns work. in particular:

  • is the first route pattern that matches is blocking all subsequent patterns?
  • is there a else pattern allowing to catch all requests and provide a 404 error
  • how to handle the request and build the response in another function and call it from the router block
  • how to include a route block inside a function and nest them in sub-functions

I failed to find an answer to these questions and I fail to see how the router block can help be since I can't use it.

mildred avatar Aug 04 '20 13:08 mildred

  1. Yes. First pattern rules.

  2. Yes, at the bottom of your routes:

routes:
  [..]
  error {Http401 .. Http408}:
    resp("End")

ThomasTJdev avatar Aug 04 '20 16:08 ThomasTJdev

The Nim in Action book goes very in depth with Jester, where you can create an entire Twitter clone from scratch with Jester by putting into practice what you read from the book. It may be a good starting place.

Regardless, documentation embedded into the Github would massively improve this repository, I agree with that sentiment.

ArikRahman avatar Dec 29 '22 01:12 ArikRahman