Created
March 9, 2014 21:41
-
-
Save renatocantarino/9455153 to your computer and use it in GitHub Desktop.
Codigo NodeJS
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
//carrega a lib Http do Node | |
var http = require('http'); | |
//Cria um serviço web para tratar requisicao | |
var _server = http.createServer(function(request,response) | |
{ | |
//parametros do cabeçalho | |
response.writeHead(200,{'Content-Type': 'text/html'}); | |
response.write('<html><body><h1> Ola </h1> </body> </html>'); | |
//Finaliza a chamada | |
response.end(); | |
}); | |
//Porta IP para execucao da chamada | |
_server.listen(3000); | |
console.log('Node em Run'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment