Skip to content

Run a tiny http-server on your machine with no dependencies like NodeJS, NPM, Nginx, etc

Notifications You must be signed in to change notification settings

danjellesma/http-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub issues GitHub stars GitHub forks CircleCI

Http-Server

Run a web server from your current directory without installing Nginx, Nodejs, NPM, etc.

Basic Functionality

To see basic functionality, run without arguments:

docker run -it --rm -p 8080:8080 -v $(pwd):/public danjellz/http-server

Output:

Starting up http-server, serving ./
Available on:
  http://127.0.0.1:8080
  http://172.17.0.2:8080
Hit CTRL-C to stop the server

You can now visit the site in your web browser:

[Preview]

Daemon Mode

Like many images you can run your container in daemon mode by using the -d switch with the Docker run command:

docker run -d -p 8080:8080 -v $(pwd):/public danjellz/http-server

Tips

Alias

Creating an alias in your ~/.bashrc or ~/.zshrc files can make this command much shorter. Example:

alias http-server="docker run -it --rm -p 8080:8080 -v $(pwd):/public danjellz/http-server"

Allowing you to run the following and mount your current directory

http-server

Source:

Uses the NPM package found here: https://www.npmjs.com/package/http-server

About

Run a tiny http-server on your machine with no dependencies like NodeJS, NPM, Nginx, etc

Resources

Stars

Watchers

Forks

Packages

No packages published