- Operating system name
- Browser name
- Browser language
- Country name
- Device type (Mobile / Desktop)
All of the data is collected through HTTP headers.
- It parses User-Agent for operating system name, browser name, device type.
- It parses Accept-Language for browser language.
- It uses geojs API for country name. It calls geojs with IP address it takes from X-FORWARDED-FOR header.
-
It shortens URLs and return URL records to client.
-
/shorten (POST)
{ "url" : "https://github.com/berabulut", "options_enabled": true, // activate waiting page "duration": 6, // duration of waiting page "note": "Letter to a stranger." // small note to be shown in waiting page }
-
/:key (GET)
Returns URL data. Key is unique id of shortened link. Usage:
localhost:8080/ab123
-
/details (GET)
Does same thing with
/:key
but returns multiple records (up to 3). Usage :localhost:8080/details?keys[0]=ab123&keys[1]=ab321&keys[2]=ab231
-
-
Redirects client to target URL and collects user data.
-
/:key (GET)
Redirects to target URL. Key is unique id of shortened link. Usage:
localhost:8080/ab123
-
sh build.sh
Exposes api to localhost:8080 and redirect to localhost:8081.