Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme vor verb() #2

Open
mm765 opened this issue Jan 8, 2016 · 1 comment
Open

Readme vor verb() #2

mm765 opened this issue Jan 8, 2016 · 1 comment

Comments

@mm765
Copy link

mm765 commented Jan 8, 2016

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
Copy link
Contributor

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 [email protected] 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
#2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants