+
Skip to content

hooto/httpsrv

Repository files navigation

httpsrv

httpsrv is a Lightweight, Modular, High Performance MVC web framework for the Go language.

Documents:

Quick Start

first hello world demo

package main

import (
    "github.com/hooto/httpsrv"
)

type Hello struct {
    *httpsrv.Controller
}

func (c Hello) WorldAction() {
    c.RenderString("hello world")
}

func main() {

	mod := httpsrv.NewModule()

	mod.RegisterController(new(Hello))

	srv := httpsrv.NewService()

	srv.SetLogger(httpsrv.NewRawLogger())

	srv.HandleModule("/demo", mod)

	srv.Start(":3000")
}
go run hello.go
curl http://localhost:3000/demo/hello/world

hello world

Licensing

Licensed under the Apache License, Version 2.0

About

Lightweight, Modular, High Performance MVC web framework for Golang

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载