This is a basic implementation of a HTTP web server.
This project provides a skeleton for a simple web server that can host different files. Only GET methods are supported.
The project uses Java 25.
Lower versions can be supported by adapting Main.java to use the typical public static void main(String[] args)
signature.
- Ensure that the current version of Java is 25
java --version
- Navigate to project root (i.e. the same directory as this README)
- Run the following commands:
javac -d out src/server/SimpleHttpServer.java src/server/Worker.java src/Main.javajava -cp out Main
- Populate
wwwwith the content to be hosted on the web server (some example files have been added already) - Run
Main.pyto launch the web server (it has been configured to read fromwwwand listen to port 8080) - Navigate to
http://localhost:8080on a browser or runcurl http://localhost:8080from the command line