Last active
March 29, 2020 07:38
-
-
Save yanivk1984/3a7e46b3e3fadc0e2c9cc8b7ef4cc58e 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
| 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