This repository has been archived by the owner on Apr 3, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
signup wired up enough to demonstrate
- Loading branch information
Showing
4 changed files
with
78 additions
and
42 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 |
---|---|---|
@@ -1,9 +1,36 @@ | ||
var express = require('express'); | ||
var express = require('express'), | ||
http = require('http'); | ||
|
||
var app = express.createServer(); | ||
|
||
app.use(express.bodyParser()); | ||
|
||
app.post('/verify', function(req, res) { | ||
var body = JSON.stringify({ | ||
assertion: req.body.assertion, | ||
audience: "http://127.0.0.1:8080" | ||
}); | ||
|
||
var vreq = http.request({ | ||
host: '127.0.0.1', | ||
port: '10002', | ||
path: '/verify', | ||
method: 'POST', | ||
headers: { | ||
'Content-Length': body.length, | ||
'Content-Type': 'application/json' | ||
} | ||
}, function (vres) { | ||
var body = ""; | ||
vres.on('data', function(chunk) { body += chunk; }); | ||
vres.on('end', function() { | ||
res.send(body); | ||
}); | ||
}); | ||
vreq.write(body); | ||
vreq.end(); | ||
}); | ||
|
||
app.use(express.static(__dirname + "/static")); | ||
|
||
app.listen(process.env['PORT'] || 8080, '127.0.0.1'); |
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
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
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