Skip to content

entrlcom/go-http-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published