ellipse
v0.5.5
Published
Minimalistic toolchain to make writing of vanilla http servers more enjoyable.
Downloads
34
Maintainers
Readme
Ellipse
It's a super-simplified web framework inspired by Express for those cases when you don't need templates, render engines and all the fancy stuff. A combination of a router, a middleware chain and a bunch of response helper utilities. Not more, not less.
Usage
var ellipse = require('ellipse'),
app = ellipse()
app.get('/', function (req, res) {
var name = req.query.name || 'Ellipse'
res.send('Welcome ' + name + '!')
})
app.get('/:name', function (req, res) {
res.html('<h1>Hello ' + req.params.name + '!</h1>')
})
app.get('/:greeting/:name', function (req, res) {
res.json({
status: 'success',
data: {
greeting: req.params.greeting,
name: req.params.name
}
})
})
app.listen(3333, function () {
console.log('server is ready to accept connections on port 3333')
})
For more information, see the examples.
Installation
With npm:
npm install --save ellipse
With git:
git clone git://github.com/schwarzkopfb/ellipse.git