A multi-threaded file-based web server. The server supports only GET (read) operations.
- Java 1.8
- Maven 3.6.1
- Apache Commons Lang
- Apache Commons CLI
- Karate
- Exec Maven Plugin
- JUnit 5
- Jacoco
- Sonar Cloud
- Travis CI
- Installed Java 8
- Installed Maven (tested with version 3.6.1)
Execute following command to compile and run the program: mvn clean package exec:java
.
The server runs on 65535
port and resources from /src/test/resources
directory will be exposed.
Unit tests are run as part of build process.
Integration tests might be called with mvn test -Dtest=ServerTest
command. For testing purposes default server
configuration exposes a demo page downloaded from: https://colorlib.com/preview/theme/atomic/
The server supports GET
requests only.
- When existing resource is requested then the file is returned by the server with
200
status code - When existing directory is requested and the directory contains
index.html
file then the file is returned with200
status code - When existing directory is requested but it doesn't contain
index.html
file then403
status code is returned - When nonexisting resource is requested then
404
status code is returned
In case of other requests 501 NOT IMPLEMENTED
response is returned.
-d <arg>
- allows to specify server root directory. Default value:.
-p <arg>
- HTTP port number to run the server. Default value: 65535-t <arg>
- number of threads used by server incoming requests. Default value: 20