GithubHelp home page GithubHelp logo

simplserv's Introduction

A simple HTTP server in python for web development

Set up a very simple HTTP server for testing your AJAX-calls without having to use something like MAMP or LAMP.

Only programmed with UNIX based systems in mind.

Features

  • Set custom hostnames. Automaticly alters the /etc/hosts file and adds host if it does not exist. Default value is to use local ip (127.0.0.1)
  • Select port to use. Default value is 8080.
  • Automaticly opens your default browser to the given host.

Installation

Run the sudo make install command. This will copy the script to a hidden folder in your home directory, and make a symbolic link in your /usr/bin directory. If you are skeptical of running sudo commands on the bash script, take a look in the Makefile to see full list of commands.

To uninstall use the sudo make uninstall command. Or run

rm -rf ~/.simplserv
rm -f /usr/bin/simplserv

Usage

$ simplserv -h

usage: simplserv [-h] [-v] [-p PORT] [-host HOSTNAME]

Start a simple HTTP server, for simpler testing of AJAX calls, 
pathing of files and auto adding host name.

optional arguments:
  -h, --help      show this help message and exit
  -v, --version   show program's version number and exit
  -p PORT         The port to use for the HTTP server
  -host HOSTNAME  Hostname alias

Example:

$ simplserv -host simplserv.dev -p 8800
Serving at http://simplserv.dev:8800/
localhost - - [27/Feb/2012 15:34:52] "GET / HTTP/1.1" 200 -
localhost - - [27/Feb/2012 15:34:52] code 404, message File not found
localhost - - [27/Feb/2012 15:34:52] "GET /favicon.ico HTTP/1.1" 404 -

If you are using a custom hostname for the first time, you probably need to run the command as sudo, as it requires premissions to the /etc/hosts file. You can omit sudo the second time of running, though.

simplserv's People

Contributors

mikaelbr avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar  avatar

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.