Serve static Pug templates from an Express server.
It's an NPM package. You can just do the following.
npm install pug-staticImport 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/"));
This is a fork of jade-static, thanks shovon for the code! The project was renamed, so our team needed this.
- Compiles JADE files on the fly.
- Serves
/path/index.pugwhen/pathis requested. - Serves
/path/index.pugwhen/path/index.htmlis requested.
- No caching of any kind
MIT