pipress
v0.0.6
Published
Tiny server hosting [pi0.io](https://pi0.io) (or anything else!)
Downloads
17
Readme
🗿 pipress
Tiny server hosting pi0.io (or anything else!)
💡 How it works?
Idea is simple, Turn any base url with raw Markdown, HTML and Assets into a website!
Website contents can be hosted anywhere, such as from https://raw.githubusercontent.com/pi0/pi0.io (pi0/pi0.io).
When opening a URL like /about, the server fetches {BASE_URL}/about.md and renders Markdown to HTML using md4w.
The web server then uses {BASE_URL}/index.html as an HTML template, replacing the {{ content }} placeholder with the rendered markdown content.
Any other URL ending with an extension, will be directly fetched and served as static asset with proper mime type.
All remote content are cached with simple SWR strategy (stale 1 second).
Check the source code.
✅ Local preview
Local dir:
npx pipress .Or remote URL:
npx pipress https://raw.githubusercontent.com/pi0/pi0.io/refs/heads/main👉🏻 Self-hosted using docker
docker-compose.yaml:
services:
www:
image: ghcr.io/pi0/pipress
restart: unless-stopped
environment:
PIPRESS_URL: "https://raw.githubusercontent.com/pi0/pi0.io/refs/heads/main"
ports:
- 3140:3000[!TIP] Use https://github.com/containrrr/watchtower for auto updates
⚙️ Env variables
PIPRESS_URLPIPRESS_TTL(default1000)PIPRESS_STATIC_TTL(default1000)
