servedir

command module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

Command servedir

CI Godoc Slack chat

Simple HTTP server inspired by python -mSimpleHTTPServer.

Serves files from given directory on specified or next free port.

Install and run with

> go install foxygo.at/servedir@latest
> servedir
Starting HTTP server at http://localhost:52537

There are options for port, listen interface and directory, see servedir --help.

Development

Tooling is bootstrapped with Hermit, activate it with . ./bin/activate-hermit. Run make to view help available make targets.

Documentation

Overview

The servedir command starts an HTTP server, serving files from either the current directory or a specified directory, on the next free ephemeral port or a specified port.

go run foxygo.at/servedir@latest --help
usage: servedir [-a] [-p <port>] [<dir>]

Simple HTTP server, serving files from given directory.

  -a	listen on all interfaces not just localhost (env: SERVEDIR_ALL_INTERFACES)
  -p int
        port number (default: os chosen free port) (env: SERVEDIR_PORT)
  <dir> defaults to current directory if not specified

Jump to

Keyboard shortcuts

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