web/

directory
v1.3.10 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0

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

Path Synopsis

Jump to

Keyboard shortcuts

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