Skip to content

Instantly share code, notes, and snippets.

@steren
Last active May 15, 2018 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steren/cc16b50cee2f75295ecd3fd45119cf88 to your computer and use it in GitHub Desktop.
Save steren/cc16b50cee2f75295ecd3fd45119cf88 to your computer and use it in GitHub Desktop.
Simple Node.js hello world for App Engine standard
runtime: nodejs8
{
"name": "hello-world",
"version": "1.0.0",
"description": "Oh hi there",
"scripts": {
"start": "node server.js"
},
"author": "Myles Borins <mylesborins@google.com>",
"license": "Apache-2.0",
"dependencies": {
"express": "^4.16.2"
}
}
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('🎉 Hello Node.js on App Engine Standard! 🎉');
});
const server = app.listen(process.env.PORT || 8080, () => {
const host = server.address().address;
const port = server.address().port;
console.log(`Example app listening at http://${host}:${port}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment