decafjs / decaf-jolt

WWW Server/Application framework for decaf
MIT License
0 stars 1 forks source link

Readme vor verb() #2

Open mm765 opened 8 years ago

mm765 commented 8 years ago

This was one that caused me some headache yesterday or so: In the readme it says: app.verb('blog', function(config, req, res) { res.send('blog entry requested is ' + req.args[0]); ));

but the config parameter in the function does not seem to exist. I think it should be app.verb('blog', function(req, res) { res.send('blog entry requested is ' + req.args[0]); ));

mschwartz commented 8 years ago

https://github.com/decafjs/decaf-jolt/blob/master/lib/Application.js#L182

handler is called with (config, req, res) if you pass it a config:

app.verb('blog', { handler function(config, req, res) { ... })

For example, StaticServer, the config {} would contain the path of the files being served, among other things.

The example in the README is fixed.

On Thu, Jan 7, 2016 at 8:20 PM, mm765 notifications@github.com wrote:

This was one that caused me some headache yesterday or so: In the readme it says: app.verb('blog', function(config, req, res) { res.send('blog entry requested is ' + req.args[0]); ));

but the config parameter in the function does not seem to exist. I think it should be app.verb('blog', function(req, res) { res.send('blog entry requested is ' + req.args[0]); ));

— Reply to this email directly or view it on GitHub https://github.com/decafjs/decaf-jolt/issues/2.