connect-dir

0.0.2 • Public • Published

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)

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i connect-dir

      Weekly Downloads

      2

      Version

      0.0.2

      License

      BSD-2-Clause

      Last publish

      Collaborators

      • bhurlow