URL Shortener API
Demo of a Web Application that exposes an API, which shortens a url that has been specified and some statistics about his used.
Web application developed in Java language. Implementing a simple architecture for the development of a RESTFul API using the "Spring Boot" framework.
This API consists of 5 main components:
- The "Main" class is what is the responsibility to lift the service.
- The "Controller" Classes that exposes the main API "endpoints".
- The "Service" Classes are responsible for encapsulating and implementing the business logic.
- The "Repository" Class that is responsible for accessing the database.
- The "Dto" class that functions as "Data Transfer Object" encapsulating the data and representing the API response
This application was created with a project using the Eclipse development IDE.
It is the initial version of the development.
- Version: 1.0
Download the source code to your local development environment:
git clone https://github.com/Rart3001/URLShortenerApi
Go to the URLShortenerApi folder:
cd URLShortenerApi
Compile the application and download its dependencies with the following command.
mvn install
java -jar target / URLShortenerApi-0.0.1-SNAPSHOT.jar
Enter your web browser and place the following address:
http://localhost:8080/api/v1/short/status
If everything goes well you can see in your browser the following message.
Service running! :)
(GET) http://localhost:8080/api/v1/short/status
(POST) http://localhost:8080/api/v1/short/ + www.mylargeurl.com... "url to shorten in the body request"
(GET) http://localhost:8080/api/v1/short/{idUrl}
(GET) http://localhost:8080/api/v1/statistics/status
(GET) http://localhost:8080/api/v1/statistics/?date=yyyy-MM-dd
(GET) http://localhost:8080/api/v1/statistics/?start_date=yyyy-MM-dd&end_date=yyyy-MM-dd
- Test writing
- Code review.