URL Shortening Service

개발환경

  • 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로 리다이렉트 합니다.

How to run and use

  1. this project clone to your local

    git clone https://github.com/thxwelchs/shorteningurl.git
    cd shorteningurl
  2. if you want to run the tests

    ./gradlew clean test
  3. application build and run in your local (dev mode)

    ./gradlew bootRun
  4. 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 curl

    curl -s -X POST -H "Content-type: application/json" http://localhost:8082/api/shortening-urls -d "https://www.google.com"

    img

  5. request to unshorten url (application must be running and have shortenedURL)

    Enter the shortenedURL in your browser