GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - redpeacock78/H-awk: ๐Ÿฆ… Express-style HTTP server for GNU AWK

BranchesTags
Open more actions menu

Latest commit

 

History

891 Commits
891 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
bin
bin
 
 
core
core
 
 
data
data
 
 
docs
docs
 
 
dsl
dsl
 
 
libexec
libexec
 
 
libs
libs
 
 
public
public
 
 
scripts
scripts
 
 
tests
tests
 
 
views
views
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
CLAUDE.md
CLAUDE.md
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.ja.md
README.ja.md
 
 
README.md
README.md
 
 
app.awk
app.awk
 
 
hawk.awk
hawk.awk
 
 

Repository files navigation

H-awk

CI License: MIT Ask DeepWiki

Write backends in plain AWK. No Node. No Python. No compiled binaries.


Features

  • Express-like routing โ€” hawk.app.get, .post, .del, and friends
  • Type-safe DSL โ€” let, when...of, ??, |>, and compile-time type annotations
  • Typed collections โ€” List<T>, Dict<K, V>, Record (JSON-aware)
  • URL helpers โ€” libs/url Zig-backed URL encode/decode with AWK fallback
  • JSON helpers โ€” libs/json Zig-backed JSON encode/decode; typed ctx.res.json(List<Todo>)
  • Gzip compression โ€” libs/gzip HTTP response compression; HAWK_GZIP=1 to enable
  • XSS-safe by design โ€” brand types make unsafe HTML a desugar-time error
  • Multi-worker โ€” SO_REUSEPORT + HTTP/1.1 keep-alive via optional Zig extensions

Quick Start

Requirements: gawk 5.0+, bash 4.3+, GNU make

cp .env.example .env
./bin/hawk app.awk        # Start on :8080 (multi-worker requires libs/net)
curl http://localhost:8080/
curl -X POST -d 'title=buy+milk' http://localhost:8080/todos
curl -X DELETE http://localhost:8080/todos/1234
BEGIN {
  hawk.app.get("/todos", "list_todos")
  hawk.app.post("/todos", "add_todo")
  hawk.app.listen(8080)
}

function list_todos() {
  let rows = []
  let n: Int = read_tsv("data/todos.tsv", rows)
  let payload = []
  payload["count"] = n
  return ctx.res.json(payload)
}

function add_todo() {
  when ctx.req.form("title") of
    ok raw:
      ctx.res.status(201)
      return ctx.res.html(safe.html.fragment(
        "<li>", safe.html.escape(raw), "</li>"
      ))
    ng:
      ctx.res.status(400)
      return ctx.res.text("title required")
  end
}

Documentation

Setup & Installation Requirements, build-libs, fetch-libs
CLI Reference Subcommands and flags
Routing Route registration, router files
DSL Reference let, when...of, ??, `
API Reference Context API, request/response, env::
Plugins Plugin hooks, submodule distribution
Native Extensions Zig libs, cache API, multi-worker
Testing Test targets and CI

MIT ยฉ redpeacock78 ยท ๐ŸŒ ๆ—ฅๆœฌ่ชž

About

๐Ÿฆ… Express-style HTTP server for GNU AWK

Topics

awkawk-langawk-languageawk-scriptback-endbackendframeworkgnu-awkhttp-serverzigziglang

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.