Created
November 16, 2018 15:05
-
-
Save hugopeixoto/1e7e0cb35a2a147c5668d63b861795bf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
{ | |
"dependencies": { | |
"express": "^4.16.4", | |
"selfsigned": "^1.10.4", | |
"spdy": "^4.0.0" | |
} | |
} |
This file contains hidden or 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
const spdy = require("spdy"); | |
const express = require("express"); | |
const path = require('path'); | |
const selfsigned = require('selfsigned'); | |
const app = express(); | |
app.get('/', (req, res) => { | |
res.sendFile(path.join(__dirname, "index.html")); | |
}); | |
app.get("/oauth/callback", (req, res) => { | |
}); | |
const pems = selfsigned.generate( | |
[{ name: 'commonName', value: 'localhost' }], | |
{ days: 365 }, | |
); | |
spdy | |
.createServer({ key: pems.private, cert: pems.cert }, app) | |
.listen(8080); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment