bung87 / scorper

scorper is a micro and elegant web framework written in Nim
Apache License 2.0
81 stars 5 forks source link

Improved Documentation #36

Closed shayanhabibi closed 2 years ago

shayanhabibi commented 3 years ago

As I try to understand the tests and procedures within, I'm just writing it down.

I've added more comprehensive examples; still to be completed. Hoping that I've got the basics correct so far.

bung87 commented 3 years ago

LGTM , please continue! Thank you for your love.

shayanhabibi commented 3 years ago

Yes but you do have a basicAuth proc that handles decoding and accepts a validating closure.

I think I’m being misunderstood. I’m asking if my use of the procedure request.basicAuth is correct as it is not in the test suite tbasicauth

On Fri, 13 Aug 2021 at 10:43 am, Bung @.***> wrote:

@.**** commented on this pull request.

In DRAFT_USAGE.md https://github.com/bung87/scorper/pull/36#discussion_r688206258:

  • Do things here because request was invalid

  • RESPONSE UNNECESSARY; see note below

  • basicAuth proc returns a bool; however any failure to validate the auth header

  • will result in an automatic response of either Http400 or Http401. An if/else

  • statement can be used however responses for failure are unnecessary.

  • Using the statement below is therefore perfectly valid

  • #
  • if not await request.basicAuth(validator): return

  • +# Can create router here or set server handler directly +let address, flags = "127.0.0.1:8888", {ReuseAddr} +let server = newScorper(address, handler, flags) +server.start() +waitFor server.join() +```

emm, I did not design a validator schema, this part need handled by end developer.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bung87/scorper/pull/36#discussion_r688206258, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN2EZWY5ICZXRBAG2UBYRRLT4SBFRANCNFSM5CAZKGJA .

shayanhabibi commented 3 years ago

You are right! Will resolve and include the explanation in docs

On Fri, 13 Aug 2021 at 10:48 am, Bung @.***> wrote:

@.**** commented on this pull request.

In DRAFT_USAGE.md https://github.com/bung87/scorper/pull/36#discussion_r688207559:

+<!--- Note: request default respError codes --->

I haven't need this feature from my experience. It seems all server and frameworks response 500 due to internal program error. well If you have better design of default error code for helping end user development, welcome to create a PR .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bung87/scorper/pull/36#discussion_r688207559, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN2EZWZXLSKZDD5ZFKDLFD3T4SBW3ANCNFSM5CAZKGJA .

bung87 commented 3 years ago

hi, is this ready for merge ? how to contact you ? I want discuss something of development with you.

shayanhabibi commented 3 years ago

Hey Bung, I have not worked further on the documentation since I became involved with the CPS project. I can do some work on it tomorrow to tie up the loose ends and let you know when its ready to merge.

Let me know what you have in mind. I am always available on the CPS matrix chat to (see http://github.com/nim-works/cps).

We do seem to have some implementation of httpleast that is comparable or faster to httpbeast (however we are pursuing multithreading over async atm).

bung87 commented 2 years ago

any news ? I plan to update during spring festival.