// app.js
var http = require('http');
var fs = require('fs');

var server = http.createServer(function(request, response) {
    fs.readFile(__dirname + '/estados-cidades.json', function(err, arquivo) {
        response.writeHeader(200, {
            'Content-Type': 'application/json'
        });
        response.write(arquivo);
        response.end();
    });
});

server.listen(3000, function() {
    console.log('Executando Servidor HTTP');
});

@@ -207,48 +207,448 @@
     
-response.writeHeader(200, %7B%0A            
+var headers = %7B%7D;%0A%09    headers%5B%22Access-Control-Allow-Origin%22%5D = %22*%22;%0A%09    headers%5B%22Access-Control-Allow-Methods%22%5D = %22POST, GET, PUT, DELETE, OPTIONS%22;%0A%09    headers%5B%22Access-Control-Allow-Credentials%22%5D = true;%0A%09    headers%5B%22Access-Control-Max-Age%22%5D = '86400'; // 24 hours%0A%09    headers%5B%22Access-Control-Allow-Headers%22%5D = %22X-Requested-With, Access-Control-Allow-Origin, X-HTTP-Method-Override, Content-Type, Authorization, Accept%22;%0A%09    headers%5B
 'Con
@@ -661,9 +661,11 @@
 ype'
-:
+%5D =
  'ap
@@ -683,25 +683,54 @@
 son'
-%0A
+;%0A%09
     
-    %7D
+response.writeHead(200, headers
 );
-%0A
     
+%0A%09
     
@@ -809,9 +809,9 @@
 ten(
-3
+8
 000,

Update app06.js