Skip to content

Instantly share code, notes, and snippets.

@odirleiborgert
Created May 23, 2018 17:34
Show Gist options
  • Save odirleiborgert/4469a0fb91c1ba112dd67aaa8f9932c8 to your computer and use it in GitHub Desktop.
Save odirleiborgert/4469a0fb91c1ba112dd67aaa8f9932c8 to your computer and use it in GitHub Desktop.
Azure com node e express 4
// Funciona na Azure
var http = require('http');
var server = http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.end("Hello World!");
});
var port = process.env.PORT || 3000;
server.listen(port);
// Não funciona na Azure
var express = require('express');
var app = express();
app.get('/', function(req, res){
res.send('Hello World');
});
app.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment