artanis
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Artanis] Beginner: How to use the following in artanis


From: Wensheng Xie
Subject: [Artanis] Beginner: How to use the following in artanis
Date: Wed, 4 Jul 2018 15:15:27 +0800

Hi, artanis:

Two questions:

1. how to use Config API
e.g.
(current-myhost)
causes unbund error.

2. how to use HTTP Basic authentication
the code
;; test HTTP Basic authentication (BA) implementation
(use-modules (artanis artanis))
(init-server)

(define (my-checker rc user passwd)
  (and (string=? user "jack") (string=? passwd "123")))

(post "/bauth" #:auth `(basic ,my-checker)
  (lambda (rc)
    (if (:auth rc)
        "auth ok"
            (throw-auth-needed))))

(run #:port 8080)

but
http://localhost:8080/bauth/
is 404.

best regards,
wxie

--
I'm an FSF member -- Help us support software freedom! https://my.fsf.org/join

reply via email to

[Prev in Thread] Current Thread [Next in Thread]