Skip to content

aihio/domain_task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Domain Info Application

How to build the app:

Execute the following command:

./gradlew build

How to start the app:

Important note: application.properties file is encrypted with Jasypt

Option 1:

  1. Set JASYPT_ENCRYPTOR_PASSWORD=newsecretpass environmental variable
  2. Run java -jar domaintask-0.0.1-SNAPSHOT.jar

Option 2:

./gradlew bootRun --args='--jasypt.encryptor.password=newsecretpass'

How to encrypt/decrypt with Jasypt

Application description

The application starts on http://localhost:8080. The UI is hosted there with simple form that requires user to input the domain. The app uses whoisxmlapi for getting domain registrar name, expire date. The app requests domain prices from Namecheap XML API. The request is cached.

API description

The app's api is available at /api/getDomainInfo domainName is a mandatory parameter

Get exisitng domain info:

Sample request: curl --location --request GET 'localhost:8080/api/getDomainInfo?domainName=google.com' Sample response:

{
    "registrarName": "MarkMonitor, Inc.",
    "expiresDate": "2028-09-14"
}

Get domain price

In case the domain from the input does not exist the app requests domain price from external service

Sample request:

curl --location --request GET 'localhost:8080/api/getDomainInfo?domainName=runner.accountant'

Sample response:

{"price":24.88,"currency":"USD"}

Possible Improvements:

  • Get Client IP dynamically
  • Improve exception handling
  • Replace in-memory cache
  • Improve content validation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published