1
0
Fork 0
mirror of https://github.com/imjasonh/gots synced 2026-07-08 00:56:04 +00:00
No description
Find a file
Jason Hall 0853892d49 separate prod+dev JS compile
Signed-off-by: Jason Hall <jason@chainguard.dev>
2025-08-30 21:31:58 -04:00
frontend separate prod+dev JS compile 2025-08-30 21:31:58 -04:00
.air.toml separate prod+dev JS compile 2025-08-30 21:31:58 -04:00
.gitignore separate prod+dev JS compile 2025-08-30 21:31:58 -04:00
go.mod add docs, fix up air usage 2025-08-30 21:06:52 -04:00
go.sum add files 2025-08-30 21:07:03 -04:00
LICENSE add files 2025-08-30 21:07:03 -04:00
main.go separate prod+dev JS compile 2025-08-30 21:31:58 -04:00
Makefile separate prod+dev JS compile 2025-08-30 21:31:58 -04:00
README.md separate prod+dev JS compile 2025-08-30 21:31:58 -04:00

Go + TypeScript Example

A sample Go binary with embedded TypeScript frontend using go:embed.

Features

  • TypeScript frontend compiled to JavaScript with Webpack
  • Go server with embedded frontend assets
  • Hot reload development with air
  • Single binary or Docker image deployment

Development

make dev    # Start development server with hot reload

Changes to any file triggers a rebuild and reload, which takes ~3 seconds.

Build & Run

make release  # Build standalone release binary (~7.7 MB)
./bin/gojs    # Run binary

# Or run directly:
make run    # Generate assets and run

# Or build and push a multi-arch image
make image

The resulting image is ~5.3 MB

Server runs on http://localhost:8080