quickstart

command
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

演示: 最小 web 应用 —— app + ginx 两件套, 零基础组件、零外部服务。

这是接入本库的最短路径: 内嵌 app.Base 声明配置结构体, ginx.NewGroup 注册路由, app.MustRun 一条龙完成"配置加载 -> 日志 -> 路由构建 -> HTTP 启动 -> 优雅停机"。

运行:

cd example/quickstart && go run .

访问:

http://127.0.0.1:8080/api/v1/hello   业务路由
http://127.0.0.1:8080/healthz        存活检查(内置, 进程活着即 200)
http://127.0.0.1:8080/readyz         就绪检查(内置, 未注入检查器时默认就绪)

停机: Ctrl+C 优雅停机, 等待处理中的请求完成后退出。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL