A simple implementation of a web server, in Java. This application can host websites, static content, scripts, etc...
- Clone the repository in your local.
- Open a terminal/powershell in JWebServer directory
- Complie the java source files.
javac -d src/target src/**/*.java
- Create a jar out of the complied files.
jar cvf JWebServer.jar src/target/**/*.class
- Run the jar file by specifying the main class.
java -cp JWebServer.jar:src/target git.chaitanyabhardwaj.jwebserver.Main
- This should start the application. Enter a desired port number (say, 5000).
- Open a web client(any web broswer or postman) and hit http://127.0.0.1:5000 or http://localhost:5000
Congratulations🎉, your web server is now running!