This repository has been archived by the owner on May 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update README.md and add local HTTPS webserver for easy development
- Loading branch information
1 parent
415a048
commit 154b73b
Showing
2 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,28 @@ | ||
# test-pages | ||
Contains test pages used for WebRTC development | ||
[](https://travis-ci.org/webrtc/test-pages) | ||
|
||
# Intro # | ||
Collection of test pages used for WebRTC development | ||
|
||
|
||
## Development ## | ||
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). | ||
|
||
|
||
#### Clone the repo in desired folder | ||
```bash | ||
git clone https://github.com/webrtc/test-pages.git | ||
``` | ||
|
||
#### Install npm dependencies (also adds linting to precommit githooks) | ||
```bash | ||
npm install | ||
``` | ||
|
||
### Start web server for development | ||
From the root of the checkout do `cd test` then run `node server.js` and finally navigate your browser to `https://localhost:8080`. | ||
|
||
#### Linting | ||
Runs grunt which currently only does linting. | ||
```bash | ||
npm test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (c) 2017 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'); | ||
}); |