AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
# Hello World 示例 运行以下代码,通过访问http://127.0.0.1:8080/hello 输出"hello world!" ## 服务器 ~~~go package main import ( "fmt" "github.com/devfeel/dotweb" ) func main() { //初始化DotServer app := dotweb.New() //开启debug模式 app.SetDevelopmentMode() //设置路由 InitRoute(app.HttpServer) //开始服务 port := 8080 err := app.StartServer(port) fmt.Println("dotweb.StartServer error => ", err) } func Hello(ctx dotweb.Context) error { return ctx.WriteString("hello world!") } func InitRoute(server *dotweb.HttpServer) { server.Router().GET("/hello", Hello) } ~~~ ## 示例代码 https://github.com/devfeel/dotweb-example/tree/master/helloworld