Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 154b73b

Browse files
committed
Update README.md and add local HTTPS webserver for easy development
1 parent 415a048 commit 154b73b

File tree

2 files changed

+58
-2
lines changed

2 files changed

+58
-2
lines changed

README.md

+28-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,28 @@
1-
# test-pages
2-
Contains test pages used for WebRTC development
1+
[![Build Status](https://travis-ci.org/webrtc/test-pages.svg)](https://travis-ci.org/webrtc/test-pages)
2+
3+
# Intro #
4+
Collection of test pages used for WebRTC development
5+
6+
7+
## Development ##
8+
Detailed information on developing in the [webrtc](https://github.com/webrtc) GitHub repo can be found in the [WebRTC GitHub repo developer's guide](https://docs.google.com/document/d/1tn1t6LW2ffzGuYTK3366w1fhTkkzsSvHsBnOHoDfRzY/edit?pli=1#heading=h.e3366rrgmkdk).
9+
10+
11+
#### Clone the repo in desired folder
12+
```bash
13+
git clone https://github.com/webrtc/test-pages.git
14+
```
15+
16+
#### Install npm dependencies (also adds linting to precommit githooks)
17+
```bash
18+
npm install
19+
```
20+
21+
### Start web server for development
22+
From the root of the checkout do `cd test` then run `node server.js` and finally navigate your browser to `https://localhost:8080`.
23+
24+
#### Linting
25+
Runs grunt which currently only does linting.
26+
```bash
27+
npm test
28+
```

web_server/server.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3+
*
4+
* Use of this source code is governed by a BSD-style license
5+
* that can be found in the LICENSE file in the root of the source
6+
* tree.
7+
*/
8+
/* eslint-env node */
9+
10+
'use strict';
11+
12+
var express = require('express');
13+
var https = require('https');
14+
var pem = require('pem');
15+
16+
pem.createCertificate({days: 1, selfSigned: true}, function(err, keys) {
17+
var options = {
18+
key: keys.serviceKey,
19+
cert: keys.certificate
20+
};
21+
22+
var app = express();
23+
24+
app.use(express.static('../'));
25+
26+
// Create an HTTPS service.
27+
https.createServer(options, app).listen(8080);
28+
29+
console.log('serving on https://localhost:8080');
30+
});

0 commit comments

Comments
 (0)