0.2.3 • Published 6 years ago

express-index v0.2.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

express-index

NPM

What is this?*

express-index an express middleware used to generate simple and easy directory indexes.

Install

npm install --save express-index

Usage

var express = require('express');
var exindex = require('express-index');
var app     = express();

app.use("/", express.static("public"));
app.use("/", exindex("public", { theme : "darko" }));

app.listen(80);

Custom Errors

var options = {
    error : {
        // Not Found
        404 : function(req, res){
            res.send(req.url + " - Resource not found!");
        },
        // Forbidden
        403 : function(req, res){
            res.send("You shall not pass!");
        }
    }
};

Then pass the options to the route:

app.use("/", express.static("public"));
app.use("/", exindex( "public", options ));

Templates / Themes:

  • default
  • default-noimg
  • hackerman
  • darko
  • boxy

Additional Notes

  • Please report any issues here
0.2.3

6 years ago

0.2.2

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.0

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago