Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/5t111111/web-server-one-liners


https://github.com/5t111111/web-server-one-liners

Last synced: 2 days ago
JSON representation

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
```