Created
May 23, 2018 17:34
-
-
Save odirleiborgert/4469a0fb91c1ba112dd67aaa8f9932c8 to your computer and use it in GitHub Desktop.
Azure com node e express 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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