<commit_before># Ecstatic

A simple static file server middleware that works with both Express and Flatiron

* Built-in simple directory listings
* Shows index.html files at directory roots when they exist
* Use it with a raw http server, express/connect, or flatiron/union!

# Examples:

## express

``` js
var express = require('express');
var ecstatic = require('../');;

var app = express.createServer();
app.use(ecstatic(__dirname + '/public'));
app.listen(8080);

console.log('Listening on :8080');
```

## union

``` js
var union = require('union');
var ecstatic = require('../');

union.createServer({
  before: [
    ecstatic(__dirname + '/public'),
  ]
}).listen(8080);

console.log('Listening on :8080');
```

# API:

## ecstatic(folder, opts={});

Pass ecstatic a folder, and it will return your middleware!

Turn on cache-control with `opts.cache`, in seconds.

Turn on directory listings from `ecstatic.showdir` with `opts.showdir === true`.

### middleware(req, res, next);

This works more or less as you'd expect.

## ecstatic.showdir(folder);

This returns another middleware which will attempt to show a directory view. At the moment, you must add this explicitly for union and connect middleware stacks, so that one may chose actions other than showing a directory view if desired.

# Tests:

    npm test

# Contributing:

This is still "beta" quality, and you may find bugs. Please give me a heads-up if you find any! Pull requests encouraged.

# License:

MIT/X11.
<commit_msg>preferred api is autoIndex (convention from node-static/http-server)<commit_after># Ecstatic

A simple static file server middleware that works with both Express and Flatiron

* Built-in simple directory listings
* Shows index.html files at directory roots when they exist
* Use it with a raw http server, express/connect, or flatiron/union!

# Examples:

## express

``` js
var express = require('express');
var ecstatic = require('../');;

var app = express.createServer();
app.use(ecstatic(__dirname + '/public'));
app.listen(8080);

console.log('Listening on :8080');
```

## union

``` js
var union = require('union');
var ecstatic = require('../');

union.createServer({
  before: [
    ecstatic(__dirname + '/public'),
  ]
}).listen(8080);

console.log('Listening on :8080');
```

# API:

## ecstatic(folder, opts={});

Pass ecstatic a folder, and it will return your middleware!

Turn on cache-control with `opts.cache`, in seconds.

Turn on directory listings from `ecstatic.showdir` with `opts.autoIndex === true`.

### middleware(req, res, next);

This works more or less as you'd expect.

## ecstatic.showdir(folder);

This returns another middleware which will attempt to show a directory view. At the moment, you must add this explicitly for union and connect middleware stacks, so that one may chose actions other than showing a directory view if desired.

# Tests:

    npm test

# Contributing:

This is still "beta" quality, and you may find bugs. Please give me a heads-up if you find any! Pull requests encouraged.

# License:

MIT/X11.

{'fraction_non_alphanumeric': 0.11874386653581943, 'fraction_numerical': 0.011776251226692836, 'mean_word_length': 4.364912280701755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '1104437', 'n_tokens_mistral': 926, 'n_tokens_neox': 878, 'n_words': 368}