Skip to content
a Web framework for Igropyr (Chez Scheme http-server)
Branch: master
Clone or download
Latest commit 795d6e7 May 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
exemple clean up Oct 27, 2018
test update query-parser Nov 2, 2018
.gitattributes Create .gitattributes Feb 28, 2018
.gitignore Initial commit Feb 28, 2018
LICENSE update Jan 11, 2019
README.md Update README.md Sep 11, 2018
catapult.sc Update catapult.sc May 18, 2019
package.sc Update package.sc Oct 27, 2018

README.md

Catapult

Catapult is a web framwork for Igropyr

easily to write the router

(req
    ("/"                index)
    ("/index"           index)
    ("/users"           users)
    ("/notes"           notes)
    ("/blog/*/en"       blogEN)
    ("/articles/*"      article)
    ("/*"               handle404))

easily to define respone

(define index
    (lambda (header path query)
        (res "hello world")))

(define index
    (lambda (header path query)
        (res 200 "hello world")))

(define index
    (lambda (header path query)
        (res "text/html" "<h1>hello world</h1>")))
        
(define index
    (lambda (header path query)
        (res 200 "text/html" "<h1>hello world</h1>")))
(res string)                => respone content only

(res int string)            => respone status and content

(res string string)         => respone style and content

(res int string string)     => respone status, style and content

install

$ raven install catapult

use

(define res-get
        (lambda (header path query)
            ((router get path-info) header path query)))

instead of

(define get
        (lambda (header path query)
                    (response 200 "text/html" RESPONSE_STRING)))

and run

(server
    (request res-get)
    (request res-post)
    (set 
        ('staticpath "/usr/local/www/"))
    (listen 8080))

Manuel

Raven : Chez Scheme Package Manager

Igropyr is a async http-server for Chez Scheme

Catapult's sister framwork: Ballista (Express style)

You can’t perform that action at this time.