~mplscorwin/meta-express

e188f919ee9f825589aaade5bd826ae5e503fb34 — dungeon 2 years ago e401b20
take port from env otherwise use 8080
3 files changed, 33 insertions(+), 33 deletions(-)

M README.html
M README.md
M index.js
M README.html => README.html +20 -20
@@ 3,7 3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-07-04 Sun 23:14 -->
<!-- 2021-07-04 Sun 23:41 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>meta-express - get link meta-data</title>


@@ 234,12 234,12 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org060e38f">1. Requires</a></li>
<li><a href="#orgea4aa92">2. Setup</a></li>
<li><a href="#orgb55ae98">3. Test</a></li>
<li><a href="#org2b684ba">4. Related</a></li>
<li><a href="#org7970aa7">5. COPYRIGHT</a></li>
<li><a href="#org5164d14">6. LICENSE</a></li>
<li><a href="#org4f5ad89">1. Requires</a></li>
<li><a href="#org3b45c26">2. Setup</a></li>
<li><a href="#org50ec31d">3. Test</a></li>
<li><a href="#org19e4e2b">4. Related</a></li>
<li><a href="#orga4cd13b">5. COPYRIGHT</a></li>
<li><a href="#org6fad97b">6. LICENSE</a></li>
</ul>
</div>
</div>


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

<div id="outline-container-org060e38f" class="outline-2">
<h2 id="org060e38f"><span class="section-number-2">1</span> Requires</h2>
<div id="outline-container-org4f5ad89" class="outline-2">
<h2 id="org4f5ad89"><span class="section-number-2">1</span> Requires</h2>
<div class="outline-text-2" id="text-1">
<ul class="org-ul">
<li><a href="https://nodejs.dev">nodejs</a></li>


@@ 263,8 263,8 @@ Expects a URL encoded URI, returns JSON.
</div>
</div>

<div id="outline-container-orgea4aa92" class="outline-2">
<h2 id="orgea4aa92"><span class="section-number-2">2</span> Setup</h2>
<div id="outline-container-org3b45c26" class="outline-2">
<h2 id="org3b45c26"><span class="section-number-2">2</span> Setup</h2>
<div class="outline-text-2" id="text-2">
<ul class="org-ul">
<li>Set the port (e.g. in index.js)</li>


@@ 273,8 273,8 @@ Expects a URL encoded URI, returns JSON.
</div>
</div>

<div id="outline-container-orgb55ae98" class="outline-2">
<h2 id="orgb55ae98"><span class="section-number-2">3</span> Test</h2>
<div id="outline-container-org50ec31d" class="outline-2">
<h2 id="org50ec31d"><span class="section-number-2">3</span> Test</h2>
<div class="outline-text-2" id="text-3">
<p>
<a href="http://your.host:port/https://meyerweb.com/eric/tools/dencoder/">http://your.host:port/https://meyerweb.com/eric/tools/dencoder/</a>


@@ 282,8 282,8 @@ Expects a URL encoded URI, returns JSON.
</div>
</div>

<div id="outline-container-org2b684ba" class="outline-2">
<h2 id="org2b684ba"><span class="section-number-2">4</span> Related</h2>
<div id="outline-container-org19e4e2b" class="outline-2">
<h2 id="org19e4e2b"><span class="section-number-2">4</span> Related</h2>
<div class="outline-text-2" id="text-4">
<p>
No-Frills URI Encoder: <a href="https://meyerweb.com/eric/tools/dencoder/">https://meyerweb.com/eric/tools/dencoder/</a>


@@ 291,8 291,8 @@ No-Frills URI Encoder: <a href="https://meyerweb.com/eric/tools/dencoder/">https
</div>
</div>

<div id="outline-container-org7970aa7" class="outline-2">
<h2 id="org7970aa7"><span class="section-number-2">5</span> COPYRIGHT</h2>
<div id="outline-container-orga4cd13b" class="outline-2">
<h2 id="orga4cd13b"><span class="section-number-2">5</span> COPYRIGHT</h2>
<div class="outline-text-2" id="text-5">
<p>
Copyright 2021 Corwin Brust &lt;corwin@bru.st&gt;


@@ 300,8 300,8 @@ Copyright 2021 Corwin Brust &lt;corwin@bru.st&gt;
</div>
</div>

<div id="outline-container-org5164d14" class="outline-2">
<h2 id="org5164d14"><span class="section-number-2">6</span> LICENSE</h2>
<div id="outline-container-org6fad97b" class="outline-2">
<h2 id="org6fad97b"><span class="section-number-2">6</span> LICENSE</h2>
<div class="outline-text-2" id="text-6">
<p>
This program is free software.  You may use or modify


@@ 330,7 330,7 @@ License along with this program.  If not, see
</div>
<div id="postamble" class="status">
<p class="author">Author: dungeon</p>
<p class="date">Created: 2021-07-04 Sun 23:14</p>
<p class="date">Created: 2021-07-04 Sun 23:41</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

M README.md => README.md +12 -12
@@ 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.


<a id="org51464d5"></a>
<a id="org39d2993"></a>

# Requires



@@ 23,7 23,7 @@ Expects a URL encoded URI, returns JSON.
-   [link-preview-js](https://www.npmjs.com/package/link-preview-js)


<a id="orge6cb897"></a>
<a id="org8144945"></a>

# Setup



@@ 31,28 31,28 @@ Expects a URL encoded URI, returns JSON.
-   Deploy/start the application


<a id="org5603cb8"></a>
<a id="orgb5ae27d"></a>

# Test

<http://your.host:port/https%3A%2F%2Fmeyerweb.com%2Feric%2Ftools%2Fdencoder%2F>


<a id="orgd9bec12"></a>
<a id="org46085fb"></a>

# Related

No-Frills URI Encoder: <https://meyerweb.com/eric/tools/dencoder/>


<a id="org59d45df"></a>
<a id="orgf49134f"></a>

# COPYRIGHT

Copyright 2021 Corwin Brust <corwin@bru.st>


<a id="orgee0fa16"></a>
<a id="org56f2f0c"></a>

# LICENSE


M index.js => index.js +1 -1
@@ 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", "*");