forked from webrtc/samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
30 lines (23 loc) · 696 Bytes
/
server.js
File metadata and controls
30 lines (23 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree.
*/
/* eslint-env node */
'use strict';
var express = require('express');
var https = require('https');
var pem = require('pem');
pem.createCertificate({days: 1, selfSigned: true}, function(err, keys) {
var options = {
key: keys.serviceKey,
cert: keys.certificate
};
var app = express();
app.use(express.static('.'));
// Create an HTTPS service.
https.createServer(options, app).listen(8080);
console.log('serving on https://localhost:8080');
});