unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: "Thompson, David" <dthompson2@worcester.edu>
To: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
Cc: Guile User <guile-user@gnu.org>
Subject: Re: [EXT] Web development
Date: Fri, 4 Sep 2020 11:56:25 -0400	[thread overview]
Message-ID: <CAJ=RwfYnPJu2u300Q4FDcJCZsgXgD0z_bRXBhmHZFSEziwJ8pw@mail.gmail.com> (raw)
In-Reply-To: <d14c3a6e-75f4-b1ed-0aad-f4b61b1c95de@posteo.de>

On Fri, Sep 4, 2020 at 11:44 AM Zelphir Kaltstahl
<zelphirkaltstahl@posteo.de> 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



  reply	other threads:[~2020-09-04 15:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04 15:43 Web development Zelphir Kaltstahl
2020-09-04 15:56 ` Thompson, David [this message]
2020-09-04 20:55   ` [EXT] " Zelphir Kaltstahl
2020-09-05  6:29     ` Joshua Branson via General Guile related discussions
2020-09-04 16:44 ` Ricardo Wurmus
2020-09-04 20:09   ` Zelphir Kaltstahl
2020-09-04 20:25     ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ=RwfYnPJu2u300Q4FDcJCZsgXgD0z_bRXBhmHZFSEziwJ8pw@mail.gmail.com' \
    --to=dthompson2@worcester.edu \
    --cc=guile-user@gnu.org \
    --cc=zelphirkaltstahl@posteo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).