Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

CosmicToast/webdd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebDD: Web Development Daemon

status

WebDD is a high performance static webserver intended for development usage.

Install

Package (amd64 only)

wget https://minio.toast.cafe/cicd/webdd/webdd-$OS-$ARCH -o webdd (1)
chmod +x webdd
  1. Replace OS with your OS (e.g "windows") and ARCH with your architecture (e.g "amd64")

Go

go get -u toast.cafe/x/webdd

Quickstart

webdd (1)
webdd -dir=/some/dir (2)
  1. Serve the current directory

  2. Serve /some/dir

Read further for details on all the available preprocessing and how to enable/disable them.

Details

Middlewares

Asciidoc

Uses libasciidoc to pre-render asciidoc files. Will handle .html and .adoc extensions automatically. Controlled by the -asciidoc flag. Enabled by default.

Log

Logs every request. Controlled by the -log and -loglevel flags (uses logrus by default). Enabled by default.

Markdown

Uses goldmark to pre-render markdown files. Will handle .html and .md extensions automatically. Controlled by the -markdown flag. Enabled by default.

Safe

Sanitizes all requests. May be either expanded or dropped later (see current sources). Controlled by the -safe flag. Disabled by default.

Other Flags

-directory

Changes which directly is served from the current one.

Performance

Significant effort is put into making WebDD as fast and simple as possible. Official benchmarks will not be published until the 1.0 release (I’m still in the process of optimizing and refining the UX). However, preliminary benchmarks suggest up to 20x the performance of darkhttpd and up to 8x the performance of sthttpd.

Further Goals

  • CSS preprocessing

  • JSON preprocessing

  • ECMAScript preprocessing (including languages that compile to ECMAScript)

  • LiveReload injection (under consideration)

Requirements

Any further development must not incur runtime dependencies. Low performance is acceptable in the scenario of a middleware being triggered, but not otherwise. Any go modules used should be GO111MODULEs compatible.

Non-Goals

  • Routes

  • Proxying