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

Commit

Permalink
Update README.md and add local HTTPS webserver for easy development
Browse files Browse the repository at this point in the history
  • Loading branch information
KaptenJansson committed Jul 11, 2017
1 parent 415a048 commit 154b73b
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 2 deletions.
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
# test-pages
Contains test pages used for WebRTC development
[![Build Status](https://travis-ci.org/webrtc/test-pages.svg)](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
```
30 changes: 30 additions & 0 deletions web_server/server.js
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');
});

0 comments on commit 154b73b

Please sign in to comment.