Skip to content

Instantly share code, notes, and snippets.

@flpms
Last active August 24, 2019 15:48
Show Gist options
  • Save flpms/ffd0135e1db0f6c70d52 to your computer and use it in GitHub Desktop.
Save flpms/ffd0135e1db0f6c70d52 to your computer and use it in GitHub Desktop.
const http = require('http');
const callback = function(request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.write('Recebido com sucesso');
response.end();
};
http.createServer(callbackFunction).listen(1337,'127.0.0.1');
//Foi incluido um console.log aqui para saber qual porta e endereço você pode usar
console.log('Server executando no endereço 127.0.0.1:1337 \n Só testar esse endereço no seu navegador http://127.0.0.1:1337');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment