<commit_before># manage-hosts

[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)

Manage local apps and bind them to some urls via `/etc/hosts`. Whats neat is that apps can bind themselves via a REST protocol.

[![Build Status](https://travis-ci.org/orangemug/manage-hosts.svg?branch=master)](https://travis-ci.org/orangemug/manage-hosts)
[![Code Climate](https://codeclimate.com/github/orangemug/manage-hosts/badges/gpa.svg)](https://codeclimate.com/github/orangemug/manage-hosts) 
[![Dependency Status](https://david-dm.org/orangemug/manage-hosts.svg)](https://david-dm.org/orangemug/manage-hosts)
[![Dev Dependency Status](https://david-dm.org/orangemug/manage-hosts/dev-status.svg)](https://david-dm.org/orangemug/manage-hosts#info=devDependencies)


## Install
To install

    npm i git://github.com/orangemug/manage-hosts.git -g


## Usage
First off start the server

    sudo manage-hosts

This will start a server on your local machine on port `80` which will redirect requests to other servers via [bouncy](https://github.com/substack/bouncy).

### HTTP
The server has the following HTTP endpoints, to see what apps are running

    [GET] http://manage.hosts

To add an app, `POST` to the following where the key of the object is the `domain` and the value is the `ip:port`

    [PUT] http://manage.hosts
    {
      "some-domain.com": "0.0.0.0:4000"
    }

To remove an app `DELETE` with the same http body<commit_msg>Updated dep in docs.<commit_after># manage-hosts

[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)

Manage local apps and bind them to some urls via `/etc/hosts`. Whats neat is that apps can bind themselves via a REST protocol.

[![Build Status](https://travis-ci.org/orangemug/manage-hosts.svg?branch=master)](https://travis-ci.org/orangemug/manage-hosts)
[![Code Climate](https://codeclimate.com/github/orangemug/manage-hosts/badges/gpa.svg)](https://codeclimate.com/github/orangemug/manage-hosts) 
[![Dependency Status](https://david-dm.org/orangemug/manage-hosts.svg)](https://david-dm.org/orangemug/manage-hosts)
[![Dev Dependency Status](https://david-dm.org/orangemug/manage-hosts/dev-status.svg)](https://david-dm.org/orangemug/manage-hosts#info=devDependencies)


## Install
To install

    npm i git://github.com/orangemug/manage-hosts.git -g


## Usage
First off start the server

    sudo manage-hosts

This will start a server on your local machine on port `80` which will redirect requests to other servers via [node-http-proxy](https://github.com/nodejitsu/node-http-proxy).

### HTTP
The server has the following HTTP endpoints, to see what apps are running

    [GET] http://manage.hosts

To add an app, `POST` to the following where the key of the object is the `domain` and the value is the `ip:port`

    [PUT] http://manage.hosts
    {
      "some-domain.com": "0.0.0.0:4000"
    }

To remove an app `DELETE` with the same http body
{'fraction_non_alphanumeric': 0.14346965699208444, 'fraction_numerical': 0.006596306068601583, 'mean_word_length': 4.256499133448873, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3240704', 'n_tokens_mistral': 1089, 'n_tokens_neox': 987, 'n_words': 250}