directory
Version:
v1.3.10
Opens a new window with list of versions in this module.
Published: Sep 26, 2025
License: Apache-2.0
Opens a new window with license information.
README
¶
web
Move to https://github.com/go-spring-projects/web
Quick start
# http server config
http:
# listen address
addr: ":8080"
package main
import (
"context"
"go-spring.dev/spring/gs"
_ "go-spring.dev/spring/web/starter"
"go-spring.dev/web"
)
type App struct {
Router web.Router `autowire:""`
}
func (app *App) OnInit(ctx context.Context) error {
app.Router.Get("/greeting", app.Greeting)
return nil
}
func (app *App) Greeting(ctx context.Context) string {
return "greeting!!!"
}
func main() {
gs.Object(new(App))
if err := gs.Run(); nil != err {
panic(err)
}
}
Directories
¶
Click to show internal directories.
Click to hide internal directories.