simple api, made with nodejs, to shorten urls.
- short any urls
- long url id option
- password protection
- cookie protection
- timed url
group|short user id|url id
- group : user id / 1000
- short user id : an unique user id (no digits)
- url id : the key of the shortened link (start with a digit)
example : 0Ca$2C
-
install nodejs packages
npm update
-
create a certificate
openssl genrsa -out key.pem 1024
openssl req -new -key key.pem -out csr.pem
openssl x509 -req -in csr.pem -signkey key.pem -out cert.pem
-
rename configuration.js.sample to configuration.js
-
(optional) set the passphrase in configuration.js
-
install the database with database.sql
-
set the database username, password... in configuration.js
-
change WD variable in nodejs_url_shortener
-
install the daemon
sudo cp nodejs_url_shortener /etc/init.d/
sudo chmod 0755 /etc/init.d/nodejs_url_shortener
sudo update-rc.d nodejs_url_shortener defaults
node ./bin/www
or
sudo service nodejs_url_shortener start