forked from ilife5/lifesinger.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c714a2a
commit 165acdd
Showing
6 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body { | ||
background: red; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
define(function(require) { | ||
|
||
require('./a.css') | ||
|
||
var b = require('./b') | ||
b.print() | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
define({ | ||
|
||
print: function() { | ||
document.body.innerHTML = 'OK' | ||
} | ||
|
||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>test</title> | ||
</head> | ||
<body> | ||
<script src="https://a.alipayobjects.com/seajs/seajs/2.1.1/sea.js"></script> | ||
<script> | ||
|
||
seajs.use('./a') | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
var express = require('express') | ||
var http = require('http') | ||
|
||
var app = express() | ||
var cfg = { | ||
clientPort: 9998, | ||
clientHost: getExternalIpAddress() | ||
} | ||
|
||
app.use(express.static(process.cwd())) | ||
|
||
|
||
app.listen(cfg.clientPort, cfg.clientHost, function() { | ||
console.info('Start client server<' + cfg.clientHost + ':' + cfg.clientPort + '>') | ||
|
||
}).on('error', function(e) { | ||
if (e.code === 'EADDRINUSE') { | ||
consle.info('Port %d is in use, will auto find another one.', cfg.clientPort) | ||
} else { | ||
throw e | ||
} | ||
}) | ||
|
||
function getExternalIpAddress () { | ||
var interfaces = require('os').networkInterfaces() | ||
var addresses = [] | ||
Object.keys(interfaces).forEach(function(name) { | ||
interfaces[name].forEach(function(node) { | ||
if (node.family === 'IPv4' && node.internal === false) { | ||
addresses.push(node) | ||
} | ||
}) | ||
}) | ||
|
||
if (addresses.length > 1) { | ||
return addresses[1].address | ||
} | ||
if (addresses.length > 0) { | ||
return addresses[0].address | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>test</title> | ||
</head> | ||
<body> | ||
<iframe src="iframe.html"></iframe> | ||
|
||
<p> | ||
<a href="https://github.com/totorojs/totoro/issues/93">https://github.com/totorojs/totoro/issues/93</a> | ||
</p> | ||
|
||
</body> | ||
</html> |