serve

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 7 Imported by: 0

README

serve

Just a simple http server for Go

Example

package main

import "github.com/tidwall/serve"

func main() {
	serve.Serve(serve.Options{
		Handler: http.HandlerFunc(myHandler),
		Domain:  "example.com",
	})
}

func myHandler(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "<h1>HIYA!</h1>")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(opts Options)

Serve ...

Types

type Options

type Options struct {
	LogOutput interface{}
	Handler   http.Handler
	Domain    string
	DevMode   bool
	Port      int
	CertFile  string
	KeyFile   string
}

Options ...

Jump to

Keyboard shortcuts

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