-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Hello World example leverages secret APIs #539
Comments
tried to fork & run site but it's jekyll which I've never been able to run successfully. |
Hi @Sequoia , that's a good point on our documentation. We do write that
and so the return value from our method is whatever Node.js returns. It looks like they don't document the return value, either. Besides it getting fixed here, getting their documentation to also mention the return value would also be valuable to the entire Node.js community :) |
I agree that we should be more explicit, and I'll pursue clarifying the Node docs as well. To be fair, the last sentence in the doc does show (in code) the value that it returns:
But I think we should clarify. So, should we just state that
@dougwilson @hacksparrow Do you agree? Should we change our Hello World example? |
SGTM
Perhaps. So I think the idea was to get the print statement to show the address and port being listened to. We could eliminate The other option is to just change it to the following: var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('Hello World!');
});
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
}); |
👍 @dougwilson's revised version. IMO "hello world" should show the absolute minimum to get an app running, in order to avoid confusion. If @crandmck That code only shows that |
OK I updated the API doc as noted above: caf6ada +1 on @dougwilson's suggestion above. I believe @hacksparrow said he'll change Getting Started. I also opened an issue to update the Node docs accordingly as well. |
Updated the example for all languages, according to Doug's suggestion. |
Thanks @hacksparrow ! |
http://expressjs.com/en/starter/hello-world.html
docs say nothing about a return value for
app.listen
, although the code docs do.In any event that usage is definitely not good for a hello-world example.
The text was updated successfully, but these errors were encountered: