Be sure to checkout out the scope of the project for information on special features, routes, etc
The server is deployed at karakelley.rocks where several public files/directories are currently being served. If you want to check the functionality and poke around without spinning up the server locally with your own directory, this is a great option.
$ docker pull klkelley/http-server:master.latest
To pull a specific image:
$ docker pull klkelley/http-sever:<IMAGE-NAME>
Visit the HTTP-Server DockerHub Repo to pick a specific image.
There are three different types of tagged images:
master.latestwhich is considered to be the most up to date image associated with the master branch- Images specific the latest build on a development branch, i.e.
feat-get-request.latest. - Immutable images for each merge to master. These are designated as
master.<SHA>and are the only group of images that do not change.
Running the below command will automatically pull and run the image specified
$ docker run -it --rm -p 8080:8080 -v <DIRECTORY YOU WANT TO SERVE>:<PATH WHERE DIRECTORY WILL BE MOUNTED> klkelley/http-server:master.latest --port 8080 --directory <MOUNTED PATH>
An example: ex. docker run -it --rm -p 8080:8080 -v /Users/karakelley/:/var/public klkelley/http-server:master.latest --port 8080 --directory /var/public
$ gradle build
The default port is set to 0 and can be set to specific port by passing a port number as an argument.
$ java -jar build/libs/http-server.jar -p <OPTIONAL PORT NUMBER> -d <OPTIONAL DIRECTORY PATH>
$ gradle test
Supported requests:
- GET
- POST
- PUT
- DELETE
Features: Basic authorization & Query Parameters
Basic Authorization credentials:
- username: admin
- password: chicago32
Special routes:
/parsewhich supports query parameters/redirectmewhich will redirect you back to root
Without a directory: If you do not pass in a directory the root page will display "Hello World".
With a directory:
If a requested directory contains an index.html file it will be served otherwise the directory listing will be served.
Two UML diagrams are served in the directory /files/UML. Here you will find a class diagram and package diagram illustrating the entire project.