ShortLink is a simple service to make tiny url. It is excellent solution in internal network. It works based main on expressjs and sequelize modules with sqlite3.
git clone https://github.com/exnext/shortlink.git
cd shortlink
npm install
npm start
#or
node shortlink.jsYou can build yours own web page to use the shortlink service or can use added example. Our example has based on VUE framework. Change our logo for yours and have fun full functionality service.
On web browser set url address served by the shortlink (e.g http://localhost:8080). Shortlink service should redirect you to path /add.
Default values are defined in shortlink.js. Each value can be overridden by config.json file.
{
port: 8080,
address: "localhost",
database: "./shortlink.db"
}You can override part or all default values (e.g change port or database). You have to create file config.json contains overrides values.
{
"port": 8001,
"address": "0.0.0.0",
"database": "./file.db"
}{
"port": 8002,
"database": ":memory:"
}The service supports reCAPTCHA. You have to set fields into config.json to enable feature. The solution has used recaptcha-verify module.
{
"recaptcha": {
"siteKey": "YOUR SITE KEY",
"secretKey": "YOUR SECRET KEY"
}
}Below are examples to configurations for apache and linux service
<VirtualHost *:80>
ServerName YOUR-DOMAIN
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
ProxyPreserveHost On
ProxyRequests Off
</VirtualHost>server {
listen 80;
server_name YOUR-DOMAIN;
location / {
proxy_pass http://localhost:8080/;
}
} Save configuration from below example to /lib/systemd/system/shortlink.service. Change YOUR-PATH before...
[Unit]
Description=shortlink service
After=network-online.target
[Service]
Restart=on-failure
WorkingDirectory=/YOUR-PATH/shortlink/
ExecStart=/usr/bin/node /YOUR-PATH/shortlink/shortlink.js
[Install]
WantedBy=multi-user.target...and next execute commands
systemctl daemon-reload
systemctl enable shortlink
systemctl restart shortlinkHere is Live demo with restrictions. Project from github works with full functionality.

