From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Zelphir Kaltstahl Newsgroups: gmane.lisp.guile.user Subject: Re: [EXT] Web development Date: Fri, 4 Sep 2020 22:55:58 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2362"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: Guile User To: "Thompson, David" Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Sep 04 22:56:18 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kEIks-0000VY-MD for guile-user@m.gmane-mx.org; Fri, 04 Sep 2020 22:56:18 +0200 Original-Received: from localhost ([::1]:44666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEIkr-0007gx-DU for guile-user@m.gmane-mx.org; Fri, 04 Sep 2020 16:56:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35148) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEIkh-0007go-Lx for guile-user@gnu.org; Fri, 04 Sep 2020 16:56:07 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:57143) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEIkb-0005my-M4 for guile-user@gnu.org; Fri, 04 Sep 2020 16:56:07 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 743752400FC for ; Fri, 4 Sep 2020 22:55:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1599252959; bh=UNdDBEHfKVopBVkUAQDVQGhL8hIxoQDj6TnfyMXAgUk=; h=Subject:To:Cc:From:Date:From; b=FbZMwgH/yxHJHvJgXXn39wfIagW0jFXiaVBh0rL3qoAguFmM0JpcTf2huZhmeShDP jbrAXnsTgQkq3TjzfuC4DhP2p+OIdEgno6HvUrJQEDSyDmhr9v3KhGnyjMjMBYPisU dvvAiTUOw9XIo+0xcsEwMt2w16YaUaOoGwuWbIUF44SKUO6maCJ2CvNNaeNBedFMwX 5+kGe4QcjTKbSh8cwTmQG/oH7st2Ym/ew8AH3FjDK1G/XZYtPegzGMY5uqXnR9+Cp+ sEe8xDhHfvtbsLRYXX142vMrIgJslZ9epXCWP4izmNEGR9G2yKmSZEf9ZQNGlk4sQ4 pOfXDG401Yu3A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4BjqhZ5zYhz6tm9; Fri, 4 Sep 2020 22:55:58 +0200 (CEST) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=185.67.36.66; envelope-from=zelphirkaltstahl@posteo.de; helo=mout02.posteo.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/04 16:55:59 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.107, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16850 Archived-At: Hi David! On 9/4/20 5:56 PM, Thompson, David wrote: > On Fri, Sep 4, 2020 at 11:44 AM Zelphir Kaltstahl > wrote: >> Hello Guile Users! >> >> Today I wanted to try developing a website in Guile again. I took a look >> at GNU Artanis, but unfortunately it seems to be not compatible with >> Guile 3 or at least not yet released for Guile 3. At least version 0.4.1 >> on Guix seems to still depend on Guile-2.2.x. So I thought "Hmmm I had >> that example project once, but the issue was with serving static files >> not being a good idea using Guile's web server." So that leads me to the >> next point: What HTTP server to use? >> >> - I could use NGINX, but then again I don't really like NGINX >> configurations, even though I am familiar with it. >> >> - I could try and get familiar with HAProxy. This seems to have the >> advantage of being GPLv2. >> >> But how to create a development setup? I'd like to not install Docker on >> this particular system (so far it is very clean, only using free >> software), but still keep my system clean. Perhaps I could use Guix >> somehow (Guix containers?). Both, NGINX and HAProxy, seem available on Guix. >> >> I seem to remember, that sending static files via Guile's web server >> would be slow or insecure and that other HTTP servers make use of >> sendfile or something, to be fast. Also they take care of MIME types >> etc. I would be OK with being a bit slower, if I don't have to make a >> huge effort to handle MIME types and whatever other stuff correctly. But >> if there was something already implemented in Guile somewhere, which I >> could copy for my project, perhaps that would work too. >> >> I would like to have a local development environment, where I can start >> a server (and the Guile service behind it) with a command and shut it >> down again, but keeping my system rather clean. >> >> So I have a few questions: >> >> (1) How do you do your Guile web development? What's the setup? >> >> (2) What do you use to serve static files (securely)? If you use Guile's >> web server, how exactly do you do it? Do you have the code somewhere? >> >> (3) Perhaps there is a minimalistic option instead of NGINX or HAProxy >> out there, which is also free software? Is there perhaps even anything >> in Guile, which I could use, that is suitable for serving static files? > I have never run a guile web application in a production environment > but the same general pattern for web applications written in other > languages would apply here: > > * nginx (or equivalent) sits in front and all requests go through it first > * nginx handles all static file requests because it is very good at > serving static files > * all other requests are passed to the guile web application via reverse proxy > > Artanis is the only web framework I know of for Guile, but I've never > used it. I wrote the initial version of the 'guix publish' tool using > Guile's built-in web server and used the built-in pattern matcher for > handling the very simple request routing it needed. > > Hope this helps, > > - Dave OK thanks for the pointer, I'll look at guix publish! Best regards, Zelphir