- Language:
Java 11(adopt-openjdk-11)
- Framework:
Spring Boot 2.4.4
- build:
gradle 6.8.3(wrapper)
- URL 입력폼 제공 및 결과 출력
- URL Shortening Key는 8 Character 이내로 생성되어야 합니다.
- 동일한 URL에 대한 요청은 동일한 Shortening Key로 응답해야 합니다.
- 동일한 URL에 대한 요청 수 정보를 가져야 한다(화면 제공 필수 아님)
- Shortening된 URL을 요청받으면 원래 URL로 리다이렉트 합니다.
-
this project clone to your local
git clone https://github.com/thxwelchs/shorteningurl.git cd shorteningurl
-
if you want to run the tests
./gradlew clean test
-
application build and run in your local (dev mode)
./gradlew bootRun
-
request to shorten url (application must be running)
default port:
8082
http method:POST
http header Content-type:application/json
api endpoint url:http://localhost:{default port}/api/shortening-urls
http request body(raw text):{to shorten url}
Use curlcurl -s -X POST -H "Content-type: application/json" http://localhost:8082/api/shortening-urls -d "https://www.google.com"
-
request to unshorten url (application must be running and have shortenedURL)
Enter the shortenedURL in your browser