npm and error messages

This commit is contained in:
2018-10-27 03:51:47 -05:00
parent 692ab70565
commit 025a403027
29601 changed files with 2759363 additions and 14 deletions

71
node_modules/sockjs/examples/hapi/html/index.html generated vendored Normal file
View File

@@ -0,0 +1,71 @@
<!doctype html>
<html><head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"></script>
<style>
.box {
width: 300px;
float: left;
margin: 0 20px 0 20px;
}
.box div, .box input {
border: 1px solid;
-moz-border-radius: 4px;
border-radius: 4px;
width: 100%;
padding: 0px;
margin: 5px;
}
.box div {
border-color: grey;
height: 300px;
overflow: auto;
}
.box input {
height: 30px;
}
h1 {
margin-left: 30px;
}
body {
background-color: #F0F0F0;
font-family: "Arial";
}
</style>
</head><body lang="en">
<h1>SockJS Echo example</h1>
<div id="first" class="box">
<div></div>
<form><input autocomplete="off" value="Type here..."></input></form>
</div>
<script>
var sockjs_url = '/echo';
var sockjs = new SockJS(sockjs_url);
$('#first input').focus();
var div = $('#first div');
var inp = $('#first input');
var form = $('#first form');
var print = function(m, p) {
p = (p === undefined) ? '' : JSON.stringify(p);
div.append($("<code>").text(m + ' ' + p));
div.append($("<br>"));
div.scrollTop(div.scrollTop()+10000);
};
sockjs.onopen = function() {print('[*] open', sockjs.protocol);};
sockjs.onmessage = function(e) {print('[.] message', e.data);};
sockjs.onclose = function() {print('[*] close');};
form.submit(function() {
print('[ ] sending', inp.val());
sockjs.send(inp.val());
inp.val('');
return false;
});
</script>
</body></html>

9
node_modules/sockjs/examples/hapi/package.json generated vendored Normal file
View File

@@ -0,0 +1,9 @@
{
"name": "sockjs-hapi",
"version": "0.0.0-unreleasable",
"dependencies": {
"hapi": "15.x.x",
"inert": "4.x.x",
"sockjs": "*"
}
}

42
node_modules/sockjs/examples/hapi/server.js generated vendored Normal file
View File

@@ -0,0 +1,42 @@
/**
* Created by Tony on 11/1/13.
*/
var http = require('http');
var sockjs = require('sockjs');
var Hapi = require('hapi');
// 1. Echo sockjs server
var sockjs_opts = {
sockjs_url: "http://cdn.jsdelivr.net/sockjs/1.0.1/sockjs.min.js"
};
var sockjs_echo = sockjs.createServer(sockjs_opts);
sockjs_echo.on('connection', function(conn) {
conn.on('data', function(message) {
conn.write(message);
});
});
// Create a server and set port (default host 0.0.0.0)
var hapi_server = new Hapi.Server();
hapi_server.connection({
port: 9999
});
hapi_server.register(require('inert'), (err) => {
hapi_server.route({
method: 'GET',
path: '/{path*}',
handler: function(request, reply) {
reply.file('./html/index.html');
}
});
});
//hapi_server.listener is the http listener hapi uses
sockjs_echo.installHandlers(hapi_server.listener, {
prefix: '/echo'
});
console.log(' [*] Listening on 0.0.0.0:9999');
hapi_server.start();