0.0.2 • Published 10 years ago

connect-dir v0.0.2

Weekly downloads
2
License
BSD-2-Clause
Repository
github
Last release
10 years ago

Connect-content

This is connect middleware for serving static content from a "content" dir. inspired by kriby and stacey I wanted a way to use the file system as a basic cms.

this middleware attaches the data found in the "content" directory to the req object

it does not however provide any templating logic. express has got that covered

Usage


var app = express()
var cms = require('connect-dir')

app.use(cms())

app.get('*', function(req, res) {
  var data = req.content
  res.json(data)
})

app.listen(process.env.PORT || 3000)
0.0.2

10 years ago

0.0.1

10 years ago