浏览代码

Add full HTTP(S) support and update documentation

Matt Coles 9 年之前
父节点
当前提交
c0de5013ee
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 2 2
      README.md
  2. 4 0
      index.js

+ 2 - 2
README.md

@@ -2,9 +2,9 @@
2 2
 
3 3
 [![forthebadge](http://forthebadge.com/images/badges/uses-badges.svg)](http://forthebadge.com)
4 4
 
5
-Server for Integrated Project, powered by Express.js and Redis, listens only on HTTPS now, currently using a self-signed cert, will have to play with trust authorities on the ionic side. Also at the moment server responds to `ALL` requests, cause it's easier to do testing with `GET`, will also set up unit tests in good time. Everything in the API documentation is working as described.
5
+Server for Integrated Project, powered by Express.js and Redis, listens for HTTPS requests on port 443 and HTTP requests on port 80 and port 3000. Certificate provided for free by the brilliant __[Lets Encrypt!](https://letsencrypt.org/)__ project. At the moment server responds to `ALL` requests, cause it's easier to do testing with `GET`, will possibly set up unit tests in good time. Everything in the API documentation is working as described.
6 6
 
7
-![HTTPS Screenshot](http://i.imgur.com/lQHnE3V.png "HTTPS Hello World")
7
+![HTTPS Screenshot](http://i.imgur.com/jPfO0Fv.png "HTTPS Hello World")
8 8
 
9 9
 * [ip-project-server](#ip-project-server)
10 10
     * [Installation](#installation)

+ 4 - 0
index.js

@@ -43,6 +43,10 @@ if (production === "-p") {
43 43
   var prkey = fs.readFileSync('key.pem');
44 44
   var certi = fs.readFileSync('cert.pem');
45 45
 
46
+  app.listen(80, function() {
47
+    console.log('Now accepting connections on port 80.');
48
+  });
49
+
46 50
   https.createServer({
47 51
     key: prkey,
48 52
     cert: certi