Almost-Static Websites

Almost-Static Websites

If you are not interested in web development, then skip this article.

Unless, that is, you have a web developer in your startup who is complaining that the framework he or she has to use is overkill for the simple landing page that you need.

Introduction

A few months ago I decided that I was fed up with web frameworks like React, NextJS, RedwoodJS, and so on.

Most of my little websites are one-pagers, and so using a full-on web development framework is like bringing an excavator along on a day out to the beach with the kids.

A responsive HTML5 static web page is fine.

The pros

The advantages of a static website are:

  • no need to learn a complicated web framework
  • fewer processes to have running on your server that can crash
  • fewer files to manage
  • less difficulty in finding the relevant files to edit and tweak them
  • no code to maintain

The cons

However, there is one thing - static web pages cannot receive feedback from the site visitors. Specifically, they don't handle forms, and you need forms if you want people to sign up to a mailing list on your startup's landing page.

As it turns out, there is no way to have a static website handle forms. You do need a web server for forms.

But what you don't need is a web framework where the developers love to introduce breaking changes for every major release, and move everything around into different folders or re-architect the framework model so you spend most of your time playing a game of "where is it now?"

The solution

After several days of research I had to conclude that a true static website was never going to be able to deal with forms. The best I could come up with was to find the simplest free JavaScript webserver out there, which appears to be Express.

With it you lose the benefit of not having a process running on the server, but you gain the capability for form parsing.

And so I present a repository with the simplest web server setup I could come up with to allow you to process forms:

https://github.com/kf106/almost-static

One file for the web server, one for the web page, and one as a response when someone subscribes. No database is used, so there's no risk of an SQL injection attack, which makes this about as simple and easy as it can be.

Examples

I use this template for the following websites that I host on my home server:

thinklair.com

www.nomath.tech

www.lobotomy.fi


John Kraski

Strategic Events and Partnerships // Driving Revenues Through LinkedIn Content and Community // $7M Raised Mark Cuban-Backed Startup // Author, The Future of Community

10 个月

Love this Keir Finlow-Bates !

Steven Tomlinson

Co-Founder @ Pakana and Firm Solutions

10 个月

I have had this same experience and I am a “seasoned” DotNet developer. I have solved it a couple of different ways. I have settled on two solutions depending upon the situation. 1) Embed Google Forms 2) I setup an Azure function to accept a POST request from my forms then I save the data to Azure Table Storage. I pass along some hashed data that I use as a simple verification of the request source to prevent spam. Azure has recently added a database capability to the Static Web App service that I am going to try next time. https://www.online-tech-tips.com/google/how-to-embed-google-forms-on-your-website/

Leslie Owusu-Appiah

Technical Solutions Architect @ localhost % | Solutions Engineering

10 个月

Hacked together similar a few years back (needs a serious rewrite and some thought): https://github.com/localhost-international/website. I use it for both https://localhost.international/ and https://leslieoa.com/. I use markdown for my content, and one JS file for pages transitions. Works without JS, and tested on text/line mode browsers. I really should improve it. Ah! Also: “free” hosting on GH pages.

John Kost

Founder @ LVS.ai

10 个月

I've mentioned HTMX before in other comments, but since nobody really cares about my suggestions here it is again .. https://htmx.org/

John Fabiszewski

Cyber-Security Analyst | Freelance Developer

10 个月

Definitely a need for it. HTMX?

要查看或添加评论,请登录

Keir Finlow-Bates的更多文章

  • Liquid Momentum

    Liquid Momentum

    (Article 3 in a series on decentralized exchanges and memecoins) In the previous two articles, I looked at how…

    6 条评论
  • Stirring the Liquidity Pool

    Stirring the Liquidity Pool

    (Article 2 in a series on decentralized exchanges and memecoins) In my previous article, I described how even if a…

    11 条评论
  • Insufficient Liquidity

    Insufficient Liquidity

    Every adult knows that the claw machines at fairgrounds are rigged. The gripping strength of the claw is weakened for…

    28 条评论
  • What happens when Bitcoin's block subsidy runs out?

    What happens when Bitcoin's block subsidy runs out?

    Miners are an essential component of the Bitcoin blockchain?—?they package transactions into blocks and publish them…

    31 条评论
  • There are not going to be 21 million BTC

    There are not going to be 21 million BTC

    There are not going to be 21 million BTC. I confess, that was a social media "hook" to get you to read on.

    70 条评论
  • Why Quantum Computing will not Crack Blockchain Burner Addresses

    Why Quantum Computing will not Crack Blockchain Burner Addresses

    This article is sponsored by Resonance Security. There are ongoing concerns about the impact that quantum computing…

    41 条评论
  • The CHEQs Crypto-Quiz Answers

    The CHEQs Crypto-Quiz Answers

    Last week we set a crypto-quiz over at CHEQs to give people the chance to test their crypto-security knowledge. The…

    20 条评论
  • The three top reasons for bad computer security

    The three top reasons for bad computer security

    (This post is sponsored by Resonance Security) It should be clear by now to anyone who uses the Internet that there is…

    11 条评论
  • How not to promote your new blockchain

    How not to promote your new blockchain

    Over the years I've seen new (and not so new) chains vying for attention using the following techniques: paying…

    31 条评论
  • Interview with the CEO of Beta?Breakers

    Interview with the CEO of Beta?Breakers

    A while back, Charles from Resonance Security scheduled a meeting for me to talk to the CEO of Beta Breakers, Evan…

    3 条评论

社区洞察

其他会员也浏览了