Superstatic Service Architecture

**Services** are separate NPM modules that extend the functionality of `superstatic` in one way or another. One example is environment configuration, another might be an HTTP Proxy.

## Configuration

Each service should be named `superstatic-servicename` and will be configured in `superstatic.json` under `services`. For example:

```json
{
  "services": {
    "proxy": {}
  }
}
```

## Mount Point

By default, services will be mounted to a namespace on `__`, so the `proxy` service would live at `/__/proxy` and be activated for those URLs. To mount a service to a different path, you can provide an `@` in the configuration:

```json
{
  "proxy@/my-proxy/location": {}
}
```

**Note:** Services are activated for **every path prefixed with their mount point**. You should not mount a service in a location that will contain or receive other requests.

## Implementation

Superstatic services are (more or less) just factories that accept configuration information and return [Connect middleware](http://www.senchalabs.org/connect/). A rough example:

```js
module.exports = function(config) {
  return function(req, res, next) {
    res.end(config.message);
  }
}
```