Skip to content

simbafs/kama

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kama

/kam-á/
橘子的臺語
Tangerine in Taiwanese Hokkien

中文版

Kama is a lightweight Go package for building frontend-backend separated web applications.

In development mode, it proxies all unmatched HTTP requests to a frontend dev server (e.g. Vite, Next.js).
In production mode, it serves static files from an embedded filesystem, with optional overrides from a local directory—no recompilation required.

Features

  • Supports both net/http and gin framework
  • Proxies requests to a frontend dev server during development
  • Serves static files via embed.FS in production
  • Allows local static file override on top of embedded files

Installation

go get github.com/simbafs/kama

Quick Overview

//go:embed all:static
var embededFS embed.FS

kama.New(embeddedFS,
  kama.WithDevServer("http://localhost:3001"),
  kama.WithPath("static"),
)

Usage

See the _example/ directory for simple examples. There is a complete example counter

License

MIT