LaunchKit · 2026
Back to Skills

Build and modify web services using ngamux, a simple HTTP router for Go.

0
417 downloads
by @hadihammurabi

Setup & Installation

openclaw skills install @hadihammurabi/ngamux

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install ngamux

What This Skill Does

ngamux is a lightweight HTTP router for Go that handles route definition, middleware chaining, and request/response processing. It supports path parameters, wildcards, route grouping, and multiple response types including JSON, plain text, and HTML templates.

ngamux provides a fluent request/response API and tree-based route matching without requiring a heavyweight framework, keeping Go web service code concise and idiomatic.

When to use it

  • Adding authentication middleware to a group of protected API routes
  • Parsing JSON request bodies into Go structs for a REST endpoint
  • Serving file uploads from a multipart form with size limits
  • Organizing versioned API routes under a common /api/v1 prefix
  • Returning HTML template responses for a server-rendered Go web app

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: create a REST endpoint that accepts a JSON user payload and returns the created user

AGENT
  1. 1Define a POST route with mux.Post("/users", createUserHandler)
  2. 2In the handler, decode the request body using req.JSON(&user)
  3. 3Validate and process the user struct in Go
  4. 4Send a 201 Created response with ngamux.Res(rw).Status(http.StatusCreated).JSON(user)
OUTPUT

A working POST /users handler that parses JSON input and returns the created user as JSON