From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Amirouche Boubekki Newsgroups: gmane.lisp.guile.user Subject: Re: Lightweight web modules for Guile? Date: Sat, 30 Jun 2018 19:15:32 +0200 Message-ID: <11bfdad9db5062c0f0f96c4c165c1e1b@hypermove.net> References: <20180629232155.401e608e@merlin.browniehive.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1530378852 22943 195.159.176.226 (30 Jun 2018 17:14:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 30 Jun 2018 17:14:12 +0000 (UTC) User-Agent: Roundcube Webmail/1.1.2 Cc: Guile user , Zelphir Kaltstahl , tantalum , guile-user To: Tonton Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jun 30 19:14:08 2018 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZJRn-0005t0-JH for guile-user@m.gmane.org; Sat, 30 Jun 2018 19:14:07 +0200 Original-Received: from localhost ([::1]:47491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZJTt-0007F5-Om for guile-user@m.gmane.org; Sat, 30 Jun 2018 13:16:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZJTK-0007F0-HP for guile-user@gnu.org; Sat, 30 Jun 2018 13:15:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZJTJ-0000ag-7n for guile-user@gnu.org; Sat, 30 Jun 2018 13:15:42 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:45307) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fZJTE-0000HM-29; Sat, 30 Jun 2018 13:15:36 -0400 Original-Received: from webmail.gandi.net (unknown [10.200.201.5]) (Authenticated sender: amirouche@hypermove.net) by relay2-d.mail.gandi.net (Postfix) with ESMTPA id 00DFE40003; Sat, 30 Jun 2018 17:15:32 +0000 (UTC) In-Reply-To: <20180629232155.401e608e@merlin.browniehive.net> X-Sender: amirouche@hypermove.net X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.70.183.194 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14667 Archived-At: On 2018-06-29 23:21, Tonton wrote: > Hey.pp project looks more like what I'd like. I'll probably packa > > Thank you both tantalum and Zelphir! > > I'm not entirely sure what I need myself to be honest, this is very > much a > learning exercise; even though I have a goal to use it. That said, the > web-app project looks more like what I'd like. I'll probably package it > for > guix also, if I use it. Let me know how it works > > On Fri, 29 Jun 2018 18:42:15 +0000 > tantalum wrote: > >> 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 -- Amirouche ~ amz3 ~ http://www.hyperdev.fr