Git Product home page Git Product logo

httpster's Introduction

httpster

Simple http server for quick loading of content.

Installation is done via npm, which is installed along with NodeJS on most platforms.

npm -g install httpster

Then from any directory where you want to have an http service running, just run

httpster

That will start up a web server on port 3333 and let you serve up any static content you wish. If you want to change the port or directory that the server runs from pass in the -p or -d options

httpster -p 8080 -d /home/somedir/public_html

HTML5 Pushstates

If you want to run a local site that supports HTML5 Pushstates (aka being able to refresh the page), pass in the option -s or --pushstate. This will map all 4oh4's to the index.html you specified as root directory.

Basic Authentication

Since you can use httpster to deploy to PaaS providers like heroku you can now secure those deployments with basic authentication. The -b or --basic_auth options will read the HTTPSTER_AUTH_USER and HTTPSTER_AUTH_PASS variables from your environment for authentication.

httpster -b

or httpster --basic_auth

If testing this locally you can also use a .env file in the directory you will run httpster from.

HTTPSTER_AUTH_USER=desired_username
HTTPSTER_AUTH_PASS=desired_password

Then use the -e or --env option to specify to load the environmental variables

httpster --env --basic_auth

Contributions

If you have some issue please feel free to add a ticket here. If you have any suggestions for features that would make this more useful please feel free to let me know.

Thanks to @GarthDB for asking for this and making me realize that I needed it too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.