Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/runk/connect-jade-static
Connect (ExpressJS) middleware for serving jade files as static html
https://github.com/runk/connect-jade-static
Last synced: about 2 months ago
JSON representation
Connect (ExpressJS) middleware for serving jade files as static html
- Host: GitHub
- URL: https://github.com/runk/connect-jade-static
- Owner: runk
- Created: 2013-07-15T07:37:29.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-11-01T22:44:07.000Z (about 2 years ago)
- Last Synced: 2024-10-14T00:32:06.294Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 28.3 KB
- Stars: 8
- Watchers: 3
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
connect-jade-static [![Build Status](https://api.travis-ci.org/runk/connect-jade-static.png)](https://travis-ci.org/runk/connect-jade-static)
===================Connect (ExpressJS) middleware for serving jade files as static html
## Installation
npm install connect-jade-static
## Usage
Assume the following structure of your project:
/views
/partials
/file.jadeLet's make jade files from `/views/partials` web accessable:
#### Express prior to 4.0
var jadeStatic = require('connect-jade-static');
app = express();
app.configure(function() {
app.use(jadeStatic({
baseDir: path.join(__dirname, '/views/partials'),
baseUrl: '/partials',
maxAge: 86400,
jade: { pretty: true }
}));
});#### Express 4.0
var jadeStatic = require('connect-jade-static');
app = express();
app.use(jadeStatic({
baseDir: path.join(__dirname, '/views/partials'),
baseUrl: '/partials',
maxAge: 86400,
jade: { pretty: true }
}));Now, if you start your web server and request `/partials/file.html` in browser you
should be able see the compiled jade template.-------------
by [http://adslot.com](http://adslot.com)