From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ricardo Wurmus Newsgroups: gmane.lisp.guile.user Subject: Re: Web development Date: Fri, 04 Sep 2020 18:44:46 +0200 Message-ID: <874kodfq4h.fsf@elephly.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6165"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.13; emacs 27.1 Cc: guile-user@gnu.org To: Zelphir Kaltstahl Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Sep 04 18:44:52 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 1kEEpX-0001Uz-TC for guile-user@m.gmane-mx.org; Fri, 04 Sep 2020 18:44:51 +0200 Original-Received: from localhost ([::1]:51368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEEpW-0000zC-GZ for guile-user@m.gmane-mx.org; Fri, 04 Sep 2020 12:44:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEEoR-0007de-Ss for guile-user@gnu.org; Fri, 04 Sep 2020 12:43:43 -0400 Original-Received: from sender4-of-o51.zoho.com ([136.143.188.51]:21196) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kEEoP-0000GL-TJ for guile-user@gnu.org; Fri, 04 Sep 2020 12:43:43 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1599237818; cv=none; d=zohomail.com; s=zohoarc; b=hDLGQ8QeY0gH8A3hBUcnsERxnmWCWEMIvmCM6/INTHpVbcvVQYC4lgcDrnCdI1SWpb9p3beXfvTrVFlq8TSx3ajoRy2Xw0qLo4HtQwA1P0BXhEVd/KIxXudlJV+Jz8Qp7LFmzzoceXo/gJvP/Bc36iOGchGaiSvNnYaHv/jkUZE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599237818; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=uaXgkO+U/DWGhdgwpJOeD/g3aSucY6JuTJfe2QYbRxA=; b=mQ0fW3YXhtSZyJ1/BvT9ZK9J1mA8UnwzOJEvmR9fUInfLQyDZzUGMYuK/Tdu8RDf6iek8HJTfSRCZc1pBM6fKn/UfcEs0bLui8mz6K7HmcaFKZjDWfFpY//pGnFS38RdNLbLYExSPpJJ1SeTadcqD7q5cmuUTsGTd1WDh25Vo+U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1599237818; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Cc:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=uaXgkO+U/DWGhdgwpJOeD/g3aSucY6JuTJfe2QYbRxA=; b=Tcbcs4alttRV7zZk+7/M1hwXkzz8XAZl96+g84gLeQNryvwL1yDDw7u6Bzeu3gEu E2tDKKw7b36joUz7wMaHLC4Dg8ewFy9uBO7OgfGZAeFTJWMKP/IprY4OW74Ir+ad0D2 oukXeUd3tbHAZSKS9KRMXWJr7BYyJ80TIpGBAqPQ= Original-Received: from localhost (p54ad4e44.dip0.t-ipconnect.de [84.173.78.68]) by mx.zohomail.com with SMTPS id 1599237816216608.1151578081588; Fri, 4 Sep 2020 09:43:36 -0700 (PDT) In-reply-to: X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.51; envelope-from=rekado@elephly.net; helo=sender4-of-o51.zoho.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/04 12:36:02 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-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:16846 Archived-At: Zelphir Kaltstahl writes: > So I have a few questions: > > (1) How do you do your Guile web development? What's the setup? I don=E2=80=99t 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=E2=80=99t do much with files so I don=E2=80=99t 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=E2=80=99d= use =E2=80=9Csendfile=E2=80=9D 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=E2=80=99d use just Guile, matching on the reque= st, looking up the file in a declared directory, and using sendfile to push it to the requester. --=20 Ricardo