unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
Cc: guile-user@gnu.org
Subject: Re: Web development
Date: Fri, 04 Sep 2020 18:44:46 +0200	[thread overview]
Message-ID: <874kodfq4h.fsf@elephly.net> (raw)
In-Reply-To: <d14c3a6e-75f4-b1ed-0aad-f4b61b1c95de@posteo.de>


Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> writes:

> So I have a few questions:
>
> (1) How do you do your Guile web development? What's the setup?

I don’t use a framework in my web projects; just the included web
modules and sometimes the fibers web server.  I keep everything
stateless so that I can spin up many workers (i.e. Guile processes
with a web server listening on one of a range of local ports) and
dispatch to them from a reverse proxy such as Nginx or Lighttpd.

> (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?

I configure an assets directory and define a procedure that sanitizes
the requested file name to serve it from that directory.  I don’t do
much with files so I don’t usually do anything other than

    (call-with-input-file file-name get-bytevector-all)

for the body of the response.  But if I had to send large files I’d use
“sendfile” directly.

> (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?

Lighttpd seems to be lighter than Nginx.  If all you want is serve
static files upon request I’d use just Guile, matching on the request,
looking up the file in a declared directory, and using sendfile to push
it to the requester.

-- 
Ricardo



  parent reply	other threads:[~2020-09-04 16:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04 15:43 Web development Zelphir Kaltstahl
2020-09-04 15:56 ` [EXT] " Thompson, David
2020-09-04 20:55   ` Zelphir Kaltstahl
2020-09-05  6:29     ` Joshua Branson via General Guile related discussions
2020-09-04 16:44 ` Ricardo Wurmus [this message]
2020-09-04 20:09   ` Zelphir Kaltstahl
2020-09-04 20:25     ` Ricardo Wurmus
  -- strict thread matches above, loose matches on Subject: below --
2020-09-07  9:35 tantalum
2020-09-07 19:53 ` Zelphir Kaltstahl
2019-10-20  6:10 Diversification [ branched from Re: conflicts in the gnu project now affect guile] Todor Kondić
2019-10-20  6:14 ` John Cowan
2019-10-23  6:16   ` Amirouche Boubekki
2019-10-23  6:48     ` pelzflorian (Florian Pelz)
2019-10-23 10:37       ` Chris Vine
2019-10-23 11:25         ` pelzflorian (Florian Pelz)
2019-10-23 12:33           ` pelzflorian (Florian Pelz)
2019-10-23 19:19             ` Zelphir Kaltstahl
2020-09-05  6:15               ` Joshua Branson via General Guile related discussions
2020-09-05 11:50                 ` Web development Zelphir Kaltstahl
2020-09-05 13:09                   ` 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=874kodfq4h.fsf@elephly.net \
    --to=rekado@elephly.net \
    --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).