Execute the following command:
./gradlew build
Important note: application.properties file is encrypted with Jasypt
- Set JASYPT_ENCRYPTOR_PASSWORD=newsecretpass environmental variable
- Run
java -jar domaintask-0.0.1-SNAPSHOT.jar
./gradlew bootRun --args='--jasypt.encryptor.password=newsecretpass'
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.
The app's api is available at /api/getDomainInfo domainName is a mandatory parameter
Sample request: curl --location --request GET 'localhost:8080/api/getDomainInfo?domainName=google.com' Sample response:
{
"registrarName": "MarkMonitor, Inc.",
"expiresDate": "2028-09-14"
}
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"}
- Get Client IP dynamically
- Improve exception handling
- Replace in-memory cache
- Improve content validation