Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 791 Bytes

README.md

File metadata and controls

52 lines (35 loc) · 791 Bytes

HTTP server

Table of Content

Examples

package main

import (
	"context"

	"entrlcom.dev/http-server"
)

func main() {
	ctx := context.Background()

	// HTTP server.
	httpServer := http_server.NewHTTPServer()
	httpServer.Addr = ""     // TODO: set address.
	httpServer.Handler = nil // TODO: set handler.

	if err := httpServer.ListenAndServe(); err != nil {
		// TODO: Handle error.
		return
	}

	// ...

	// Shutdown HTTP server.
	if err := httpServer.Shutdown(ctx); err != nil {
		// TODO: Handle error.
		return
	}

	// ...
}

License

MIT

Links