diff --git a/node.js/package.json b/node.js/package.json new file mode 100644 index 0000000..43af357 --- /dev/null +++ b/node.js/package.json @@ -0,0 +1,29 @@ +{ + "name": "Janrain-Sample-Code", + "version": "0.0.0", + + "dependencies": { + "concat-stream": "~1.4.7", + "ecstatic": "~0.5.7", + "request": "~2.51.0" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git@github.com:janrain/Janrain-Sample-Code.git" + }, + "keywords": [ + "social", + "login", + "example", + "janrain" + ], + "author": "", + "bugs": { + "url": "https://github.com/janrain/Janrain-Sample-Code/issues" + }, + "homepage": "https://github.com/janrain/Janrain-Sample-Code" +} diff --git a/node.js/rpx.js b/node.js/rpx.js index e7a3bfb..22b999e 100644 --- a/node.js/rpx.js +++ b/node.js/rpx.js @@ -7,7 +7,7 @@ var ecstatic = require('ecstatic'); var request = require('request'); var concatStream = require('concat-stream'); -var staticHandler = ecstatic(__dirname) +var staticHandler = ecstatic(__dirname); http.createServer(function(request, response) { if (request.method === "GET") return staticHandler(request, response); @@ -24,8 +24,9 @@ http.createServer(function(request, response) { var url = "https://rpxnow.com/api/v2/auth_info?" + query_params; console.log("Requesting URL: ", url); request(url).pipe(response); - })) + })); } -}).listen(5000); +) +.listen(5000); console.log('Server running at http://localhost:5000/'); \ No newline at end of file