It is test technical task for the company Epassi
- DockerHub image: varg/epassi
- Application work on port
8080
by default
docker run -p 8080:8080 -v /target/test-classes:/app/target varg/epassi
- By default application has a
book.txt
file in/app/target
directory - To run with a custom file(s) you need to mount the volume (or file) to the container in the
/app/target
directory
docker run -p 8080:8080 -v /path/to/uploaded/file.txt:/app/target/file.txt varg/epassi
or folder with files
docker run -p 8080:8080 -v /path/to/files/folder:/app/target varg/epassi
- for POST request used Basic Auth with username
user
and passwordpassword
- The Swagger UI page will then be available at the following url:
http://server:port/swagger-ui.html
and the OpenAPI description will be available at the following url for json format: http://server:port/v3/api-docs
- server: The server name or IP
- port: The server port
- context-path: The context path of the application
limit
- number of words to returnfile
- path to fileignoreCase
- ignore case sensitivity (not required, defaulttrue
)
curl --location 'http://127.0.0.1:8080/api/freqency?file=.%2Ftarget%2Ftest-classes%2Fbook.txt&limit=5' \
--header 'Accept: application/json' \
--header 'Content-Type: text/plain'
curl --user user:password -X POST -F "file=@src/test/resources/small.txt" http://localhost:8080/api/freqency\?limit\=2
- Java 17 +
- Maven 3.9.5
./mvnw clean package
java -jar target/epassi-0.0.1-SNAPSHOT.jar
docker build -t test-app .
docker run -p 8080:8080 test-app
For further reference, please consider the following sections: