README
ririd
A simple 301 redirector.
Install this module.
Install
npm install
Configure
Create a config/default.json
.
{
"defaultRedirect": "https://hmdc.harvard.edu",
"redirectMap": [
{ "src": "^(.*)?jots\\.pub
A simple HTTP redirect microservice in Express.
<script type="module">
import snkattckRirid from 'https://cdn.skypack.dev/@snkattck/ririd';
</script>
A simple 301 redirector.
Install this module.
npm install
Create a config/default.json
.
{
"defaultRedirect": "https://hmdc.harvard.edu",
"redirectMap": [
{ "src": "^(.*)?jots\\.pub
quot;, "dst": "https://techscience.org" } ] }
In the configuration above, non-matching requests are redirected to hmdc.harvard.edu.
Any request which matches the regex in the src
attribute defined in the list redirectMap
is redirected to dst
Query stringg and paths are automatically appended to destination hostname.
You can turn either off by specifying
{
"defaultRedirect": "https://hmdc.harvard.edu",
"redirectMap": [
{
"src": "^(.*)?jots\\.pubquot;,
"dst": "https://techscience.org",
"withPath": false,
"withQs": false
}
]
}
npm start