https://github.com/tinacious/static-server
🚀 A tiny command line app with no external dependencies for serving any directory as a static server
https://github.com/tinacious/static-server
cli cli-app go golang server static-server
Last synced: about 1 year ago
JSON representation
🚀 A tiny command line app with no external dependencies for serving any directory as a static server
- Host: GitHub
- URL: https://github.com/tinacious/static-server
- Owner: tinacious
- License: unlicense
- Created: 2024-09-14T18:52:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-14T19:50:02.000Z (over 1 year ago)
- Last Synced: 2025-01-21T19:22:47.027Z (over 1 year ago)
- Topics: cli, cli-app, go, golang, server, static-server
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# static-server
`static-server` is a simple command line app written in Go that serves your current working directory as a static server.
- [Installation](#installation)
- [Usage](#usage)
- [Custom port](#custom-port)
- [Uninstall](#uninstall)
## Installation
Install the CLI tool:
```sh
go install github.com/tinacious/static-server@latest
```
## Usage
Run the `static-server` command in any directory you'd like to serve as a web server.
If you have the following directory `test`:
```
test
├── index.html
└── style.css
```
You can do:
```sh
cd test
static-server
```
This should serve the contents on a random port.
### Custom port
You can configure the port by passing it as an environment variable. For example, to run on port 1337 run:
```sh
PORT=1337 static-server
```
## Uninstall
Open `~/go/bin` and delete `static-server`.