Official documentation website for the Fox web framework, built with Astro and Starlight.
π Live Site: https://fox-gonic.github.io
Fox is a powerful extension of Gin that provides:
- π Automatic Parameter Binding - Bind parameters from URI, query strings, and JSON bodies with struct tags
- π Multi-Domain Routing - Route traffic based on domain names with exact and regex pattern matching
- π Structured Logging - Built-in logger with TraceID, structured fields, and automatic file rotation
- π‘οΈ Crash Protection - Graceful panic recovery with detailed error logging and stack traces
- β‘ High Performance - Minimal overhead above Gin's routing engine
- π Middleware Support - Full compatibility with Gin middleware ecosystem
- β Custom Validation - Implement IsValider interface for complex business validation logic
- π 100% Gin Compatible - Use any existing Gin middleware and handlers seamlessly
βββ public/
βββ src/
β βββ assets/
β β βββ fox-logo.svg
β βββ content/
β β βββ docs/
β β βββ index.mdx # Homepage with feature showcase
β β βββ guides/ # Getting started documentation
β β β βββ introduction.md
β β β βββ quickstart.md
β β β βββ installation.md
β β βββ features/ # Core features documentation
β β β βββ binding.md
β β β βββ multi-domain.md
β β β βββ logging.md
β β β βββ validation.md
β β βββ api/ # API reference
β β β βββ router.md
β β β βββ context.md
β β βββ examples/ # Code examples
β β β βββ basic.md
β β βββ zh-cn/ # Chinese translations (11 files)
β βββ styles/
β βββ custom.css
βββ astro.config.mjs
βββ package.json
βββ tsconfig.json
All commands are run from the root of the project, from a terminal:
| Command | Action |
|---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:4321 |
npm run build |
Build your production site to ./dist/ |
npm run preview |
Preview your build locally, before deploying |
- English (en)
- Simplified Chinese (zh-CN)
The documentation is organized into four main sections:
- Getting Started: Introduction, Quick Start, Installation
- Features: Parameter Binding, Multi-Domain Routing, Structured Logging, Validation
- API Reference: Router, Context
- Examples: Basic Usage
All content is available in both English and Simplified Chinese.
The website uses a custom CSS file (src/styles/custom.css) to match the design of gin-gonic.com, featuring:
- Dark theme by default
- Colorful feature cards (orange, green, red, blue)
- Gradient effects
- Responsive design
Dependencies:
- Astro v5.16.15
- Starlight v0.37.4
- TypeScript v5.7.3
- Sharp v0.34.5 (image optimization)
Development:
- Full TypeScript support with strict type checking
- Hot module replacement (HMR) for fast development
- Optimized production builds with automatic asset optimization
MIT License - see the LICENSE file for details