Explorar el Código

allow cors requests for world and stats.

Lucas Stadler %!s(int64=12) %!d(string=hace) años
padre
commit
a43bf573de
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      js/pixl/server.js

+ 2 - 0
js/pixl/server.js

@ -18,11 +18,13 @@ app.get('/stats', function(req, res) {
18 18
		last_active: new Date(last_active).toISOString()
19 19
	};
20 20
	res.setHeader('Content-Type', 'text/plain');
21
	res.setHeader('Access-Control-Allow-Origin', '*');
21 22
	res.send(JSON.stringify(stats, null, "  "));
22 23
});
23 24
24 25
app.get('/world', function(req, res) {
25 26
	res.setHeader('Content-Type', 'text/plain');
27
	res.setHeader('Access-Control-Allow-Origin', '*');
26 28
	res.send(JSON.stringify(world));
27 29
});
28 30