Categorygithub.com/x-mod/httpserver
modulepackage
1.0.12
Repository: https://github.com/x-mod/httpserver.git
Documentation: pkg.go.dev

# README

httpserver

Another HTTP Server use handler with context & Response Render.

Quick Start

package main

import (
	"context"
	"log"
	"net/http"

	"github.com/x-mod/httpserver"
)

func main() {
	srv := httpserver.NewServer(
		httpserver.Address(":8080"),
	)
	srv.Route(
		httpserver.Pattern("/hello"),
		httpserver.Handler(http.HandlerFunc(Hello)),
	)
	log.Println("httpserver:", srv.Serve(context.TODO()))
}

func Hello(wr http.ResponseWriter, req *http.Request) {
	wr.WriteHeader(http.StatusOK)
	_, _ = wr.Write([]byte("I'm OK"))
}

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author