Skip to content

Commit

Permalink
Added working gateway, 1st package.json and .gitignore's
Browse files Browse the repository at this point in the history
  • Loading branch information
woodsmc committed Mar 26, 2018
1 parent 35e03bf commit 027d52f
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
thirdparty/
1 change: 1 addition & 0 deletions examples/mongodb_gateway/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
16 changes: 15 additions & 1 deletion examples/mongodb_gateway/gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,15 @@
**/

var express = require('express');
var http = require('http');
var app = express();
var server = http.createServer(app);
var io = require('socket.io').listen(server);
var ioclient = require('socket.io-client');
var path = require('path');
var ipaddresses = require('./getlocalip');

var importedSis = require('../../sis/sisyphus');
var $sis = importedSis.$sis;

Expand All @@ -56,4 +62,12 @@ if ( process.argv.length == 3 ) {
myIP = process.argv[2]; //"pint.dyndns.info";
}

$sis.configureAsGateway( { gateway : "node" }, "http://" + myIP + "/", [], io, ioclient );
var node_metadata = {
ServiceType : "DataBase",
DBType : "MongoDB",
HostCloud : "AWS-Dub" };

$sis.configureAsGateway( node_metadata, "http://" + myIP + "/", [], io, ioclient );

server.listen(80);

Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ function print {
}

print "Install express"
sudo npm install express
npm install express --save
print "Install socket.io"
sudo npm install socket.io
sudo npm install socket.io-client
npm install socket.io --save
npm install socket.io-client --save
print "Installing Q, for node"
sudo npm install q
npm install q --save

print "Installing mongodb for node"
sudo npm install mongodb
npm install mongodb --save

19 changes: 19 additions & 0 deletions examples/mongodb_gateway/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Sisyphus gateway, which also supports mongodb",
"version": "1.0.0",
"description": "Sisyphus gateway, which also supports mongodb",
"main": "gateway.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "[email protected]",
"license": "Apache2",
"dependencies": {
"express": "^4.16.3",
"mongodb": "^3.0.5",
"q": "^1.5.1",
"socket.io": "^2.0.4",
"socket.io-client": "^2.0.4"
}
}
1 change: 1 addition & 0 deletions sis/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
8 changes: 4 additions & 4 deletions sis/install_npm_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ function print {
}

print "Install express"
sudo npm install express
npm install express --save
print "Install socket.io"
sudo npm install socket.io
sudo npm install socket.io-client
npm install socket.io --save
npm install socket.io-client --save
print "Installing Q, for node"
sudo npm install q
npm install q --save


19 changes: 19 additions & 0 deletions sis/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Sisyphis",
"version": "1.0.0",
"description": "Experimental framework for a fog of serverless functions",
"main": "sis.js",
"dependencies": {
"express": "^4.16.3",
"q": "^1.5.1",
"socket.io": "^2.0.4",
"socket.io-client": "^2.0.4"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "[email protected]",
"license": "Apache2"
}

0 comments on commit 027d52f

Please sign in to comment.