This is a simple url shortener project which is using in-memory db.
- Spring Boot
- Exception Handling
- Validation
- H2 Database
- Deploying to Heroku
https://java-url-shortener.herokuapp.com/
https://java-url-shortener.herokuapp.com/ZQ5IL
GET /all
[
{
"id": 1,
"url": "https://github.com/RzayevTaleh01",
"code": "GIT"
},
{
"id": 2,
"url": "https://www.linkedin.com/in/rzayevtaleh01/",
"code": "Linkedin"
}
]
GET /{code}
You will be redirected to the URL of the code.
GET /show/{code}
Parameter | Type | Description |
---|---|---|
code |
string |
Required. Code of url to fetch |
{
"id": 1,
"url": "https://github.com/RzayevTaleh01",
"code": "GIT"
}
POST /
Parameter | Type | Description |
---|---|---|
url |
string |
Required. Code of url to fetch |
code |
string |
Not Required. If it is null or empty, it will be created automatically. |
{
"url": "https://github.com/RzayevTaleh01",
"code": "git"
}
{
"id": 3,
"url": "https://github.com/RzayevTaleh01",
"code": "GIT"
}
git clone https://github.com/RzayevTaleh01/Java_UrlShortener_Project.git