From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Thompson, David" Newsgroups: gmane.lisp.guile.user Subject: Re: [EXT] Web development Date: Fri, 4 Sep 2020 11:56:25 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39037"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Guile User To: Zelphir Kaltstahl Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Sep 04 18:01:13 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 1kEE9I-000A2P-Lx for guile-user@m.gmane-mx.org; Fri, 04 Sep 2020 18:01:12 +0200 Original-Received: from localhost ([::1]:46076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEE9H-0002am-BS for guile-user@m.gmane-mx.org; Fri, 04 Sep 2020 12:01:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEE4x-0005rS-Gv for guile-user@gnu.org; Fri, 04 Sep 2020 11:56:43 -0400 Original-Received: from mail-vk1-xa2d.google.com ([2607:f8b0:4864:20::a2d]:45638) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kEE4r-0001BZ-Jm for guile-user@gnu.org; Fri, 04 Sep 2020 11:56:43 -0400 Original-Received: by mail-vk1-xa2d.google.com with SMTP id n193so1752896vkf.12 for ; Fri, 04 Sep 2020 08:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=worcester-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Nq6ThnzHO2gI7fCIBkDRv0W+8Z3UCkwaIfXw44hvyLE=; b=izPeHfJIeYpIklm9qCpmbxaFzV9TiLe+2QdsHTIBq3CAmY6NUEKdVvmZjQgvdmNDfj csKQBZQjBAudiD2DER0RLxmzh4W7fpWOVVXu8bPWpABG/dQK8cchBfpkTT3dpz8ZhvPU zexoyE+QRHqUvvFrWgzX0R4wsxIjBqwvuv0CwXhmROa5GonfFh2p4Btd8dFj8ezWVH9v cr5BdCA0Za9gFZ/6xJS4gQaWIWbiYzeQ2+AUnpO2eFVDSjzhN05nOPIJ0VZeIVRl2fAV doJapZhczWY7hBrg4Dp915GtCrrvq3dJ5pFoHauyGCT95eCVkRVQnTUptU0I9eaLhOF7 BTkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Nq6ThnzHO2gI7fCIBkDRv0W+8Z3UCkwaIfXw44hvyLE=; b=cnGHNoR+g6Argj32jErAenJIUNiGscabGe6u4qxfffh3p6jH51zg7OgjUMiunki6Mt JR/rKj7j3SwN3VuPrTL+XTZFAFMNkgbZ4Y6141aTWczlmuLmY4ADbvH+rYjnlSxjOdKL 1BSLaSYZ7TYcOn09a5OJhrFXyB/mFlzcPUwy7p2xvQXqP6v8QSC/C3/6PFm+ywPujKOV 7z5G/wFmD+vlYuUcoHs0VPVJ3cSjn1BW3ZCRGDGLnwgwK5Twl+1O5p9dMLz82/7OOTLu j4lU0QE2AlmRF2pegW8PIZ86NUN0uYqyKOOdPvCrAzgIONqHxHlRDva2JML2clzcygnb gMOQ== X-Gm-Message-State: AOAM5302zOOxYHS+HxOLUBEkcBFxualb5tVUle6DiQXrQGyibwA9B5aX EnfK6FKDPS/hdn+7Yqqgmx9KQKRvLTW14zb2rVuFQw== X-Google-Smtp-Source: ABdhPJyPbp61KUznT7yFxRQaxAeILdWNzg6+OX5C4+VnWWYhsy031+NuG2tTXGjdOHUDcuaUqTDKHv/kZRINmj3UFp0= X-Received: by 2002:a1f:c744:: with SMTP id x65mr6443585vkf.34.1599234996009; Fri, 04 Sep 2020 08:56:36 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::a2d; envelope-from=dthompson2@worcester.edu; helo=mail-vk1-xa2d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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:16845 Archived-At: 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