mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-27 21:51:47 +00:00
Enable open-in-browser in the Game Of Life example (#69)
This commit is contained in:
committed by
Daniel Wirtz
parent
b7ef21950b
commit
89e8de5d82
18
examples/game-of-life/server.js
Normal file
18
examples/game-of-life/server.js
Normal file
@ -0,0 +1,18 @@
|
||||
var open = require('opn');
|
||||
var http = require('http');
|
||||
var fs = require('fs');
|
||||
|
||||
const PORT = 9080;
|
||||
|
||||
fs.readFile('./game-of-life.html', function (err, html) {
|
||||
|
||||
if (err) throw err;
|
||||
|
||||
http.createServer(function(request, response) {
|
||||
response.writeHeader(200, {"Content-Type": "text/html"});
|
||||
response.write(html);
|
||||
response.end();
|
||||
}).listen(PORT);
|
||||
});
|
||||
|
||||
open('http://localhost:9080/game-of-life.html');
|
Reference in New Issue
Block a user