Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var express = require('express');
- var app = express();
- var helmet = require('helmet');
- var db = require('./server/database.js');
- var fs = require('fs');
- var ssl = require('ssl-root-cas');
- 'use strict';
- var rootCas = require('ssl-root-cas/latest').create();
- // default for all https requests
- // (whether using https directly, request, or another module)
- require('https').globalAgent.options.ca = rootCas;
- app.use(helmet());
- var options = {
- key : fs.readFileSync('privkey.pem', 'ascii'),
- cert : fs.readFileSync('fullchain.pem', 'ascii')
- }
- app.get('/', function(req, res) {
- res.sendFile(__dirname + '/public/index.html');
- });
- app.use('/public', express.static(__dirname + '/public'));
- var serv = require('https').createServer(options, app);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement