Skip to content

Instantly share code, notes, and snippets.

@yanivk1984
Last active March 29, 2020 07:38
Show Gist options
  • Select an option

  • Save yanivk1984/3a7e46b3e3fadc0e2c9cc8b7ef4cc58e to your computer and use it in GitHub Desktop.

Select an option

Save yanivk1984/3a7e46b3e3fadc0e2c9cc8b7ef4cc58e to your computer and use it in GitHub Desktop.
const express = require('express');
const https = require('https');
const fs = require('fs');
const port = 8000;
const path = require('path')
var key = fs.readFileSync(__dirname + '/key.pem');
var cert = fs.readFileSync(__dirname + '/cert.pem');
var options = {
key: key,
cert: cert
};
app = express()
app.get('/json', (req, res) => {
res.sendFile(path.join(__dirname + "\\examples\\show-gateways-interfaces\\extension.json"));
});
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname + "\\examples\\show-gateways-interfaces\\index.html"));
});
var server = https.createServer(options, app);
server.listen(port, () => {
console.log("server starting on port : " + port)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment