Infobip Assignment - Java URL Shortener Eng
Infobip Assignment - Java URL Shortener Eng
URL shortener
Assignment: Write an HTTP service which is used to shorten URLs, with following functionalities:
• Registration of a web address (API)
• Redirect of clients call according to the shortened URL-u
• Statistic of API calls (API)
Description:
1. Basic Architecture
The service must have two parts: configuration part and user part.
a) Account creation
b) Registration of URL-s in the „Shortener“ service
c) Statistics retrieval
Example: {
URL: 'http://stackoverflow.com/questions/1567929/website-safe-data-
access-architecture-question?rq=1',
redirectType : 301
}
Response Type application/json
Response parameters in case of a successful registration:
• shortUrl (shortened URL)
Response
Example: { shortUrl: 'http://short.com/xYswlE'}
1.2 Redirect
Redirect the client on the configurated address with the configurated HTTP status
2. General requirements
• Use Java programming language
• Make sure that the response HTTP statuses meet the REST standards (statuses
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html)
• The service needs to be written as an 'executable' or 'deployable' package.
• The application must not need any other dependency other than the ones in POM file (must
run out-of-the-box).
• In accordance with the previous requirement, it is not allowed to use databases other than the
embedded ones.
• Any framework can be used (Spring preferred)
• Make a help page (URI: /help) containing instructions of installation/run and usage
• Provide the source code with all the dependencies, preferably as a maven project.