Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
neoffPublic

About

test technical task repo

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

Getting Started

It is test technical task for the company Epassi

Run

  • 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

API

  • for POST request used Basic Auth with username user and password password
  • 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

Request examples:

Request parameters:
  • limit - number of words to return
  • file - path to file
  • ignoreCase - ignore case sensitivity (not required, default true)
Get frequency from existing file
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'
Upload file and get frequency
curl --user user:password -X POST -F "file=@src/test/resources/small.txt" http://localhost:8080/api/freqency\?limit\=2

Builds

Prerequisites

  • Java 17 +
  • Maven 3.9.5

Build and run

./mvnw clean package
java -jar target/epassi-0.0.1-SNAPSHOT.jar
Build with docker
docker build -t test-app .
docker run -p 8080:8080 test-app

Reference Documentation

For further reference, please consider the following sections:

About

test technical task repo

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages