Static super simple url shortner
yarn add gothere
or with npm
npm install -S gothere
Run
gothere --config path/to/my/config.js
and deploy!
Config file should export following:
property | type | description |
---|---|---|
name |
string |
Title of your redirecting site |
outFilePath |
string |
Filename of HTML file generated by gothere |
fallbackUrl |
string |
Gothere will redirect to that URL in case there is no match in db |
redirects |
array |
Array of objects containing path and url properties. path is unique nice page ID (ex. myshortner.com/path). url is the url where gothere will redirect to |
example config file:
module.exports = {
name: 'my shortner name',
outFilePath: 'index.html',
fallbackUrl: 'https://example.com/not-found',
redirects: [
{
path: 'search', // example.com/search -> https://google.com
url: 'https://google.com'
}
]
}