server

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(options Options) (server *webserver.Server, err error)

StartWebServerbserver starts the web server at the specified host and port and listens for incoming requests.

Example:

StartWebServer(Options{
 Host: "localhost",
 Port: "8080",
 Handler: func(w http.ResponseWriter, r *http.Request) {},
 Mode: "production",
})

Parameters: - none

Returns: - none

Types

type Options

type Options struct {
	Host    string
	Port    string
	URL     string // optional, if you want to be displayed in the logs
	Handler func(w http.ResponseWriter, r *http.Request)
	Mode    string // optional, default is production, can be development or testing
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL