This web app converts a long url into a short url and vice versa
- Java 8
- Eclipse IDE(Any newer version that supports Java EE Project and has inbuilt Maven)
- Tomcat 9
- Create a new workspace in Eclipse
- Add Tomcat 9 server to the workspace
- In Eclipse Import Menu, search for option "Projects from Git(with smart import)".
- Click next and select Clone URI
- In the URI enter the github url of the project - https://github.com/akramshuja/ShortURL.git. Also provide the credentials.
- After the project is imported in the workspace, clean the project by selecting Clean option from the Project menu.
- Right click on the project, under Maven - click Update Project.
- The final step is to run it on server. Right click on the project, Run As -> Run on Server. Select Tomcat 9 and say Finish.
- There are two services that can be accessed from the below URLs: i. http://localhost:8080/urlshortener/webapi/shortenUrl/?url=facebook.com/xyz This once stores the shorturl in the memory ii. http://localhost:8080/urlshortener/webapi/shortenUrlAlt/?url=google.com/hello This service stores the url in a text file. The text file is created in the installation folder of Eclipse by the name urlMap.txt