Include remotedev-app
This commit is contained in:
parent
f46624ff27
commit
7dbd60c155
48
bin/index.html
Normal file
48
bin/index.html
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>RemoteDev</title>
|
||||||
|
<style>
|
||||||
|
html {
|
||||||
|
min-width: 350px;
|
||||||
|
min-height: 300px;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
position: fixed;
|
||||||
|
overflow: hidden;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
#root {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
#root > div {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<script src="//npmcdn.com/react@0.14/dist/react.min.js"></script>
|
||||||
|
<script src="//npmcdn.com/react-dom@0.14/dist/react-dom.min.js"></script>
|
||||||
|
<script src="//npmcdn.com/remotedev-app@0.2/dist/remotedev-app.min.js"></script>
|
||||||
|
<script>
|
||||||
|
var socketOptions = {
|
||||||
|
hostname: location.hostname,
|
||||||
|
autoReconnect: true
|
||||||
|
};
|
||||||
|
if (location.port) {
|
||||||
|
socketOptions.port = location.port;
|
||||||
|
}
|
||||||
|
ReactDOM.render(
|
||||||
|
React.createElement(RemoteDevApp, {
|
||||||
|
socketOptions: socketOptions
|
||||||
|
}),
|
||||||
|
document.querySelector('#root')
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -1,3 +1,4 @@
|
|||||||
|
var path = require('path');
|
||||||
var express = require('express');
|
var express = require('express');
|
||||||
|
|
||||||
module.exports.run = function(worker) {
|
module.exports.run = function(worker) {
|
||||||
@ -7,9 +8,7 @@ module.exports.run = function(worker) {
|
|||||||
|
|
||||||
httpServer.on('request', app);
|
httpServer.on('request', app);
|
||||||
app.get('/', function(req, res) {
|
app.get('/', function(req, res) {
|
||||||
res.send('<html><body>' +
|
res.sendFile(path.join(__dirname, 'index.html'));
|
||||||
'<p>It works! Now point your app and monitor app to connect to this server.</p>' +
|
|
||||||
'</body></html>');
|
|
||||||
});
|
});
|
||||||
app.post('/', function(req, res) {
|
app.post('/', function(req, res) {
|
||||||
if (!req.body.data) return res.status(404).end();
|
if (!req.body.data) return res.status(404).end();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user