WIP - Flatironisms
app.http.before.push(function(req, res){
app.log.info(req.url);
res.emit('next');
})
app.router.post('/foo/bar', function () {
var submitted = this.req.body,
query = this.req.query;
res.end('posted');
});
curl -v -X POST --data 'foo="bar"&bar="baz"' 'localhost:8080/foo/bar?a="1"&b="2"`
var flatiron = require('flatiron'),
app = flatiron.app;
app.use(flatiron.plugins.cli, {
dir: __dirname,
usage: [
'This is a basic flatiron cli application example!',
'',
'hello - say hello to somebody.'
]
});
app.cmd('hello', function () {
app.prompt.get('name', function (err, result) {
app.log.info('hello '+result.name+'!');
})
})
app.start();
app.config.use('file', { file: './config/foo.json' });