Skip to content

Commit

Permalink
Added https server.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Jun 27, 2016
1 parent a8e4106 commit 8e86ef3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
'use strict'

const http = require('http')
const https = require('https')
const fs = require('fs')
const path = require('path')

const options = {
key: fs.readFileSync(path.join(__dirname, 'test', '/key.pem')),
cert: fs.readFileSync(path.join(__dirname, 'test', '/cert.pem')),
passphrase: 'test'
}
const server = http.createServer(handle)
const server2 = https.createServer(options, handle)

server.listen(3000)
server2.listen(3001)

function handle (req, res) {
res.end('hello world')
Expand Down

0 comments on commit 8e86ef3

Please sign in to comment.