This is a sample project for the Cloudonix programming test. This is a Java-based project for the Cloudonix programming test. The project contains a simple HTTP server that exposes an API endpoint for analyzing text.
The project is a Java-based web application that analyzes text input and returns the closest matching word from a pre-defined list of words. The application is built using the Vert.x framework.
To build and run this project, you will need:
Java 8 or later Maven
Build and Run To build and run the project, follow these steps:
- Clone the repository to your local machine: git clone https://github.com/Sakshamoo17/Cloudonix-ProgrammingTest.git
- Change into the project directory: cd Cloudonix-ProgrammingTest
- Build the project with Maven: mvn package
- Run the project: java -jar target/Cloudonix-ProgrammingTest-1.0-SNAPSHOT-fat.jar
- The server will start and listen on port 8080. You can access it at http://localhost:8080.
The HTTP server exposes a single API endpoint at /analyze. You can send a POST request to this endpoint with a JSON payload that contains a text field. The server will analyze the text and return the closest matching word based on character value and lexical order.
The project is structured as follows:
- 'src/main/java': Contains the Java source code for the project ~'com.vertex.main': Contains the Main class which starts the HTTP server ~'VertextProject.Vertexproject': Contains the TextAnalyzerService class which defines the HTTP routes and implements the text analysis logic
- 'src/test/java': Contains the JUnit test cases for the project ~'VertextProject.Vertexproject': Contains the AppTest class which includes a single test case for the project
This project is licensed under the MIT License.