UNPKG

ghss-node

Version:

39 lines (30 loc) 1.07 kB
module.exports = handle; var querystring = require('querystring'); function handle(request, response) { response.writeHead(200, { 'Content-Type': 'text/html' }); var body = ''; request.on('data', function(data) { body += data.toString(); }); request.on('end', function() { var decode = querystring.parse(body); console.log(decode); }) response.write('<!DOCTYPE "HTML">'); response.write('<html>'); response.write('<head><title>Teste em NODE</title></head>'); response.write('<body>Teste com sucesso?</body>') response.end(); } // module.exports.fn = function(request, response) { // response.writeHead(200, { // 'Content-Type': 'text/html' // }); // response.write('<!DOCTYPE "HTML">'); // response.write('<html>'); // response.write('<head><title>Teste em NODE</title></head>'); // response.write('<body>Teste com sucesso?</body>') // response.end(); // }