From bdc9a49021d1a3eb1563fe01f8bb255d83ef7294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Francisco=20Xavier?= Date: Tue, 7 Sep 2021 14:50:50 -0300 Subject: [PATCH] Adding button to deploy to heroku To solve the problem of ports I made a condition to use the ENV `PORT` value returned by most clounds otherwise use the default port 80. I currently use this implementation without any problems. closes #88 and closes #114 --- README.md | 2 ++ app.json | 5 +++++ bin/server | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 app.json diff --git a/README.md b/README.md index 9c829f0..7f4389f 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ localtunnel exposes your localhost to the world for easy testing and sharing! No need to mess with DNS or deploy just to have others test out your changes. +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/localtunnel/server) + This repo is the server component. If you are just looking for the CLI localtunnel app, see (https://github.com/localtunnel/localtunnel). ## overview ## diff --git a/app.json b/app.json new file mode 100644 index 0000000..60c106e --- /dev/null +++ b/app.json @@ -0,0 +1,5 @@ +{ + "name": "localtunnel-server", + "description": "localtunnel exposes your localhost to the world for easy testing and sharing!", + "repository": "https://github.com/localtunnel/server" +} \ No newline at end of file diff --git a/bin/server b/bin/server index a6bba9d..85f0386 100755 --- a/bin/server +++ b/bin/server @@ -17,7 +17,7 @@ const argv = optimist describe: 'use this flag to indicate proxy over https' }) .options('port', { - default: '80', + default: process.env.PORT || '80', describe: 'listen on this port for outside requests' }) .options('address', {