01_basic

command
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: MIT Imports: 3 Imported by: 0

README

基础用法示例

最简单的使用方式,展示如何创建一个基本的 HTTP 服务器。

功能

  • 创建一个简单的 web 服务器
  • 注册 GET 和 POST 路由
  • 使用统一响应格式

运行

go run main.go

测试

# 测试 ping
curl http://localhost:8080/ping

# 测试 echo
curl -X POST http://localhost:8080/echo \
  -H "Content-Type: application/json" \
  -d '{"name":"John","age":30}'

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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