Skip to content

Latest commit

 

History

History
55 lines (35 loc) · 819 Bytes

README.md

File metadata and controls

55 lines (35 loc) · 819 Bytes

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