pug-static

Serve static Pug files from an Express server.


Keywords
express, pug, middleware
License
MIT
Install
npm install pug-static@1.0.1

Documentation

pug-static

Serve static Pug templates from an Express server.

Installing

It's an NPM package. You can just do the following.

npm install pug-static

Usage

Import it via node's require function.

var pugStatic = require('pug-static');

Then, you would simply add it as a used middleware when you configure your Express server.

var server = express();

// You can watch just about any folder to serve the static Pug files.
server.use(pugStatic("#{__dirname}/public/"));

Why?

This is a fork of jade-static, thanks shovon for the code! The project was renamed, so our team needed this.

What it does

  • Compiles JADE files on the fly.
  • Serves /path/index.pug when /path is requested.
  • Serves /path/index.pug when /path/index.html is requested.

What it doesn't do

  • No caching of any kind

License

MIT