From e188f919ee9f825589aaade5bd826ae5e503fb34 Mon Sep 17 00:00:00 2001 From: dungeon Date: Sun, 4 Jul 2021 23:41:26 -0500 Subject: [PATCH] take port from env otherwise use 8080 --- README.html | 40 ++++++++++++++++++++-------------------- README.md | 24 ++++++++++++------------ index.js | 2 +- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/README.html b/README.html index 95d2483..e3a6569 100644 --- a/README.html +++ b/README.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + meta-express - get link meta-data @@ -234,12 +234,12 @@ for the JavaScript code in this tag.

Table of Contents

@@ -252,8 +252,8 @@ Minimal link meta-data fetch service using: Expects a URL encoded URI, returns JSON.

-
-

1 Requires

+
+

1 Requires

  • nodejs
  • @@ -263,8 +263,8 @@ Expects a URL encoded URI, returns JSON.
-
-

2 Setup

+
+

2 Setup

  • Set the port (e.g. in index.js)
  • @@ -273,8 +273,8 @@ Expects a URL encoded URI, returns JSON.
-
-

3 Test

+
+

3 Test

http://your.host:port/https://meyerweb.com/eric/tools/dencoder/ @@ -282,8 +282,8 @@ Expects a URL encoded URI, returns JSON.

-
-

4 Related

+
+

4 Related

No-Frills URI Encoder: https://meyerweb.com/eric/tools/dencoder/ @@ -291,8 +291,8 @@ No-Frills URI Encoder: https

-
-

5 COPYRIGHT

+
+

5 COPYRIGHT

Copyright 2021 Corwin Brust <corwin@bru.st> @@ -300,8 +300,8 @@ Copyright 2021 Corwin Brust <corwin@bru.st>

-
-

6 LICENSE

+
+

6 LICENSE

This program is free software. You may use or modify @@ -330,7 +330,7 @@ License along with this program. If not, see

diff --git a/README.md b/README.md index b417bbd..4c47bf2 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Table of Contents -1. [Requires](#org51464d5) -2. [Setup](#orge6cb897) -3. [Test](#org5603cb8) -4. [Related](#orgd9bec12) -5. [COPYRIGHT](#org59d45df) -6. [LICENSE](#orgee0fa16) +1. [Requires](#org39d2993) +2. [Setup](#org8144945) +3. [Test](#orgb5ae27d) +4. [Related](#org46085fb) +5. [COPYRIGHT](#orgf49134f) +6. [LICENSE](#org56f2f0c) Generate link previews Minimal link meta-data fetch service using: @@ -14,7 +14,7 @@ Minimal link meta-data fetch service using: Expects a URL encoded URI, returns JSON. - + # Requires @@ -23,7 +23,7 @@ Expects a URL encoded URI, returns JSON. - [link-preview-js](https://www.npmjs.com/package/link-preview-js) - + # Setup @@ -31,28 +31,28 @@ Expects a URL encoded URI, returns JSON. - Deploy/start the application - + # Test - + # Related No-Frills URI Encoder: - + # COPYRIGHT Copyright 2021 Corwin Brust - + # LICENSE diff --git a/index.js b/index.js index ebf8b6a..0cfe515 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,7 @@ const express = require('express'); var validUrl = require('valid-url'); const app = express(); -const port = 8217; +const port = process.env.PORT || '8080'; const sendCorsHeaders = function (res) { res.header("Access-Control-Allow-Origin", "*"); -- 2.45.2