Skip to content

ramuvaram/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

url-shortener

Getting Started

Reference Documentation

For further reference, please consider the following sections:

Guides

The following guides illustrate how to use some features concretely:

Setup H2 data base

Download h2 database from below link and install h2 database. https://www.h2database.com/html/download.html Below link contains steps to install h2 database in local https://www.tutorialspoint.com/h2_database/h2_database_installation.htm

##Apporach to implement URL shortener:

Different ways are available. I have used spring boot application to generate shorten URL. I have generated shorten url in 2 ways.

  1. Used hashmap to generate shorten url. For basic understanding I have used this approach.
  2. Used Database to store URL information. In my case I have used h2 database. We can use any database as storage device. Installed h2 database in my local and configured data base information in application.properties file. Created controller, service , model and repository classes in order to generate shorten urls.

##Steps to run spring boot application:

  1. Connect to h2 database by providing Driver class, URL , username and password.
  2. Go to project directory ( For ex: C:\Users\Dell\git\url-shortener ) and run below command mvn spring-boot:run On succesful running will get message like Starting Shortenurl application using Java
  3. Open http://localhost:8080/ in browser and will see Simple form for URL shortener
  4. Enter full URL and click on Click here to get Short URL ( In this case, Triggering generate post call where checking shorten url avaialble or not for given url. If available fetching shorten url and displayed. If not available generate and store it in Data base and displayed to the user)
  5. Copy shorten URL and pasted it in browser. It will redirected to original URL ( In this case, redirectToOriginalUrl get method implemented. Redirect to original url based on shorten url)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors