guile-user
[Top][All Lists]
Advanced

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

Re: Lightweight web modules for Guile?


From: tantalum
Subject: Re: Lightweight web modules for Guile?
Date: Fri, 29 Jun 2018 18:42:15 +0000
User-agent: Posteo Webmail

hi, not sure if it is exactly what your looking for but it might be useful for examples and matches the general question. i maintain a project named "web-app" at http://sph.mn/c/view/mu or https://github.com/sph-mn/sph-web-app the core is small and working well for me so far, ive been maintaining it for a long time. it starts a server and for each request gives a request object to a user defined procedure, which then returns a response object that is send back to the client. it comes with an optional module for file processing (templates, preprocessed files, bundling, etc) and has some more cool features like protocol independence (socket -> app -> socket), an exchangeable server (fibers included) and derived projects (using modules and symlinks).

the project hasnt gone through testing and feedback loops with other users, and the documentation, while technically probably up to date, needs revision i think. here is a minimal usage example, in a file named "example.scm":

    (import (sph web app) (sph web app http))
    (define (app-respond request) (respond "test"))
    (define app (swa-create (quote project-name) app-respond))
    (swa-start app #f swa-server-guile)

then running "guile example.scm" displays

    listening on 127.0.0.1:6500
    exit with ctrl+c

the app is then accessible with the browser at http://127.0.0.1:6500



reply via email to

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