Skip to main content
Fuego - File-based routing for Go

What is Fuego?

Fuego is a file-based routing framework for Go, inspired by Next.js App Router. Your file structure is your router - no manual route registration required.

Why Fuego?

Traditional Go routing requires manual registration:
// The old way - manual registration
r.HandleFunc("/api/users", usersHandler)
r.HandleFunc("/api/users/{id}", userHandler)
r.HandleFunc("/api/posts", postsHandler)
// ...repeat for every route
With Fuego, your file structure is your router: This maps to:
  • app/api/users/route.goGET/POST /api/users
  • app/api/users/[id]/route.goGET/PUT/DELETE /api/users/:id
  • app/api/posts/route.goGET/POST /api/posts
No registration. No configuration. Just files.

Features

Your directory structure defines your routes. Create a file, get a route.Maps to /api/users
A working API in 5 lines of code. Sensible defaults, full control when needed.
First-class templ support with compile-time HTML validation.
Build interactive UIs without client-side JavaScript frameworks.
Built-in Tailwind CSS v4 binary. No Node.js required.
Proxy layer for auth checks, rewrites, and early responses.
Sub-second rebuilds during development.
Single binary deployment, minimal dependencies.

Installation

brew install abdul-hamid-achik/tap/fuego-cli

Quick Example

// app/api/users/route.go
package users

import "github.com/abdul-hamid-achik/fuego/pkg/fuego"

// GET /api/users
func Get(c *fuego.Context) error {
    return c.JSON(200, map[string]any{
        "users": []string{"alice", "bob"},
    })
}

// POST /api/users
func Post(c *fuego.Context) error {
    var input struct {
        Name string `json:"name"`
    }
    if err := c.Bind(&input); err != nil {
        return fuego.BadRequest("invalid input")
    }
    return c.JSON(201, map[string]string{"created": input.Name})
}

Request Logging

Fuego includes a built-in request logger that captures ALL requests:
[12:34:56] GET /api/users 200 in 45ms (1.2KB)
[12:34:57] POST /api/tasks 201 in 123ms (256B)
[12:34:58] GET /v1/users → /api/users 200 in 52ms [rewrite]
The logger is enabled by default and shows color-coded HTTP methods, status codes, response times, and proxy actions.

Coming From Other Frameworks?

If you’ve used Next.js, Nuxt, SvelteKit, or similar frameworks, Fuego’s patterns will feel familiar:
PatternFileRoute
Staticapp/api/users/route.go/api/users
Dynamicapp/api/users/[id]/route.go/api/users/:id
Catch-allapp/docs/[...slug]/route.go/docs/*
Middlewareapp/api/middleware.goApplies to /api/*
Pagesapp/dashboard/page.templ/dashboard
Layoutsapp/layout.templWraps child pages

Familiar Patterns Guide

Learn how Fuego compares to frameworks you already know

Explore More