Lynx - A simple Plug based web framework
- Antony Pinchbeck
- 2018-03-20
- Elixir
Introduction
I wanted a very simple website but I also wanted to explore Plug. The result is what you are reading now. Easily maintained. No database, no login, no forgotten passwords…
First some hat tipping:
-
Sebastian Seilund wrote an article using Phoenix to serve markdown files
-
German Velasco wrote a Plug based web framework
My framework is an extension of the two for how I want to work and develop a simple website. It is not meant to be a framework for non programmers.
TLDR
It has been fun. The project took about 3 days to write and I have discovered that Plug is very powerful. If you do not need all that Phoenix gives you, maybe Plug is for you.
The framework supports:
-
Static pages such as “/contact” and “/about”
-
Dynamix pages such as “/articles/my-tile” and “/articles/projects/…”
-
Custom error pages, 404 etc
-
Etags for all files involved in a render
-
Support for .html, .html.eex and markdown files
-
Module reloading in development mode
-
Browser refresh on file changes in development mode