Skip to content

Instantly share code, notes, and snippets.

@kaysush
Last active July 30, 2022 09:20
Show Gist options
  • Save kaysush/a2fe226fe5abb3dc7d93aaf33a0458c9 to your computer and use it in GitHub Desktop.
Save kaysush/a2fe226fe5abb3dc7d93aaf33a0458c9 to your computer and use it in GitHub Desktop.
Demo Node.js application for demonstrating Traffic Management in Cloud Run
FROM node:18.7.0-alpine3.16
RUN mkdir $HOME/app
WORKDIR $HOME/app
COPY main.js .
CMD ["node", "main.js"]
var http = require("http")
var version = process.env.VERSION || "Default Version"
var port = process.env.PORT || 8080
http.createServer(function (request, response) {
response.writeHead(200, { "Content-Tye": "text/plain" });
response.end("Hello world from " + version + "\n");
}).listen(port)
console.log("Server is running at 0.0.0.0:" + port)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment