react app

This commit is contained in:
Mario Romano
2016-04-06 17:52:19 +01:00
parent f7e6ef55a2
commit 29df96a085
4425 changed files with 446323 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
<p>
Make sure to run build.js, then run server.js and visit <a href="http://localhost:1337/">http://localhost:1337/</a>.
This test should say either "Test failed" or "Test passed":
</p>
<script src="browser-source-map-support.js"></script>
<script src="script.js"></script>

View File

@@ -0,0 +1,12 @@
sourceMapSupport.install()
foo = -> throw new Error 'foo'
try
foo()
catch e
if /\bscript\.coffee\b/.test e.stack
document.body.appendChild document.createTextNode 'Test passed'
else
document.body.appendChild document.createTextNode 'Test failed'
console.log e.stack

View File

@@ -0,0 +1,25 @@
// Generated by CoffeeScript 1.7.1
(function() {
var e, foo;
sourceMapSupport.install();
foo = function() {
throw new Error('foo');
};
try {
foo();
} catch (_error) {
e = _error;
if (/\bscript\.coffee\b/.test(e.stack)) {
document.body.appendChild(document.createTextNode('Test passed'));
} else {
document.body.appendChild(document.createTextNode('Test failed'));
console.log(e.stack);
}
}
}).call(this);

View File

@@ -0,0 +1,10 @@
{
"version": 3,
"file": "script.js",
"sourceRoot": "..",
"sources": [
"header-test/script.coffee"
],
"names": [],
"mappings": ";AAAA;AAAA,MAAA,MAAA;;AAAA,EAAA,gBAAgB,CAAC,OAAjB,CAAA,CAAA,CAAA;;AAAA,EAEA,GAAA,GAAM,SAAA,GAAA;AAAG,UAAU,IAAA,KAAA,CAAM,KAAN,CAAV,CAAH;EAAA,CAFN,CAAA;;AAIA;AACE,IAAA,GAAA,CAAA,CAAA,CADF;GAAA,cAAA;AAGE,IADI,UACJ,CAAA;AAAA,IAAA,IAAG,oBAAoB,CAAC,IAArB,CAA0B,CAAC,CAAC,KAA5B,CAAH;AACE,MAAA,QAAQ,CAAC,IAAI,CAAC,WAAd,CAA0B,QAAQ,CAAC,cAAT,CAAwB,aAAxB,CAA1B,CAAA,CADF;KAAA,MAAA;AAGE,MAAA,QAAQ,CAAC,IAAI,CAAC,WAAd,CAA0B,QAAQ,CAAC,cAAT,CAAwB,aAAxB,CAA1B,CAAA,CAAA;AAAA,MACA,OAAO,CAAC,GAAR,CAAY,CAAC,CAAC,KAAd,CADA,CAHF;KAHF;GAJA;AAAA"
}

View File

@@ -0,0 +1,45 @@
var fs = require('fs');
var http = require('http');
http.createServer(function(req, res) {
switch (req.url) {
case '/':
case '/index.html': {
res.writeHead(200, { 'Content-Type': 'text/html' });
res.end(fs.readFileSync('index.html', 'utf8'));
break;
}
case '/browser-source-map-support.js': {
res.writeHead(200, { 'Content-Type': 'text/javascript' });
res.end(fs.readFileSync('../browser-source-map-support.js', 'utf8'));
break;
}
case '/script.js': {
res.writeHead(200, { 'Content-Type': 'text/javascript', 'SourceMap': 'script-source-map.map' });
res.end(fs.readFileSync('script.js', 'utf8'));
break;
}
case '/script-source-map.map': {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(fs.readFileSync('script.map', 'utf8'));
break;
}
case '/header-test/script.coffee': {
res.writeHead(200, { 'Content-Type': 'text/x-coffeescript' });
res.end(fs.readFileSync('script.coffee', 'utf8'));
break;
}
default: {
res.writeHead(404, { 'Content-Type': 'text/html' });
res.end('404 not found');
break;
}
}
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');