serve

command module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

README

Serve

Go Version Latest Release Registry License

A Simple HTTP Server Built on Top of Go

Run

Via Download
  • Download from here
Operating System Name Format
MacOS serve_{version}_darwin_{arch}
Linux serve_{version}_linux_{arch}
Windows serve_{version}_windows_{arch}.exe
  • For MacOS and Linux, make the file executable
# chmod +x serve_{version}_{os}_{arch}
$ chmod +x serve_0.0.1_linux_amd64
$ ./serve_0.0.1_linux_amd64 -h
Via Golang Install
$ go install github.com/ClavinJune/serve@latest
$ serve -h
Via Go Run
$ go run github.com/ClavinJune/serve@latest -h
Via Docker
$ docker run -it --rm ghcr.io/clavinjune/serve:latest -h

Usage

$ serve -h
Usage of serve:
  -p int
        port on which the server will listen (default 1313)
  -q    run server quietly
  -r string
        root document which the server will serve (default ".")
  -s    serve single page application

Example

$ docker run -it --rm -v /tmp/foo:/app/src -p 1313:1313 ghcr.io/clavinjune/serve:latest
2021/11/04 06:32:19 listen and server /app/src/ at http://0.0.0.0:1313
2021/11/04 06:32:23 / 46.107µs
2021/11/04 06:32:23 /favicon.ico 78.868µs
2021/11/04 06:32:40 /index.html 6.642µs
2021/11/04 06:32:40 / 31.058µs
2021/11/04 06:32:44 /foo/ 60.574µs

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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