Skip to content

Commit

Permalink
SDK-1301: Use https for Doc Scan demo
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgrayston committed Mar 19, 2020
1 parent 29dc155 commit db8ec4d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion examples/doc-scan/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
require('dotenv').config();

const express = require('express');
const https = require('https');
const fs = require('fs');
const path = require('path');
const bodyParser = require('body-parser');
const session = require('express-session');
const controllers = require('./src/controllers');
Expand All @@ -26,6 +29,9 @@ router.get('/media', controllers.mediaController);

app.use('/', router);

app.listen(port);
https.createServer({
key: fs.readFileSync(path.join(__dirname, '../keys', 'server-key.pem')),
cert: fs.readFileSync(path.join(__dirname, '../keys', 'server-cert.pem')),
}, app).listen(port);

console.log(`Server running on https://localhost:${port}`);
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions examples/profile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ app.use('/', router);
// START THE SERVER
// =============================================================================
https.createServer({
key: fs.readFileSync(path.join(__dirname, 'keys', 'server-key.pem')),
cert: fs.readFileSync(path.join(__dirname, 'keys', 'server-cert.pem')),
key: fs.readFileSync(path.join(__dirname, '../keys', 'server-key.pem')),
cert: fs.readFileSync(path.join(__dirname, '../keys', 'server-cert.pem')),
}, app).listen(port);

console.log(`Server running on https://localhost:${port}`);

0 comments on commit db8ec4d

Please sign in to comment.