Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

24 Commits

Repository files navigation

httpserver

Another HTTP Server use handler with context & Response Render.

Quick Start

package main
import (
"context""log""net/http""github.com/x-mod/httpserver"
)
funcmain() {
srv:=httpserver.NewServer(
httpserver.Address(":8080"),
)
srv.Route(
httpserver.Pattern("/hello"),
httpserver.Handler(http.HandlerFunc(Hello)),
)
log.Println("httpserver:", srv.Serve(context.TODO()))
}
funcHello(wr http.ResponseWriter, req*http.Request) {
wr.WriteHeader(http.StatusOK)
_, _=wr.Write([]byte("I'm OK"))
}

About

httpserver for grpc/pb

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages