Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/5t111111/web-server-one-liners
https://github.com/5t111111/web-server-one-liners
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/5t111111/web-server-one-liners
- Owner: 5t111111
- Created: 2015-08-19T03:10:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-11T04:22:23.000Z (about 9 years ago)
- Last Synced: 2024-04-13T16:15:55.915Z (7 months ago)
- Language: Shell
- Size: 145 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Web Server One-liners
This is a wrapper script for launching one of the following an ad hoc http static servers to launch an instant web server on the fly.
- Python 2.x SimpleHTTPServer
- Python 3.x http.server
- Ruby WEBrick via un
- PHP (5.4+)
- node-static (Node.js: node-static is required)Default is Python 2.x or 3.x depends on your environment.
## Usage
```text
$ webserver PROGRAM PORT_NUMBER
```### Example
```bash
# Default (Python 2.x or 3.x) using default port number
$ webserver# Default (Python 2.x or 3.x) with an explicit port number
$ webserver 8080# Python 2.x or 3.x
$ webserver python 8080# Python 3.x
$ webserver python3 8080# Ruby
$ webserver ruby 8080# PHP
$ webserver php 8080# node-static
$ webserver static 8080
```## Installation
Clone this repository (or just download the script file) to any location and add the directory to your PATH.
### Example
```text
$ cd ~
$ git clone [email protected]:5t111111/http-server-one-liner.git
$ export PATH=$HOME/http-server-one-liner/bin:$PATH
$ rehash # optional
```Or you can install via Homebrew.
```text
$ brew tap 5t111111/web-server-one-liners
$ brew update
$ brew install web-server-one-liners
```