Skip to content

antonhosgood/simple-web-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Simple Web Server

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.

Prerequisites

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.

Demo Instructions

  1. Ensure that the current version of Java is 25
    • java --version
  2. Navigate to project root (i.e. the same directory as this README)
  3. Run the following commands:
    • javac -d out src/server/SimpleHttpServer.java src/server/Worker.java src/Main.java
    • java -cp out Main
  4. Populate www with the content to be hosted on the web server (some example files have been added already)
  5. Run Main.py to launch the web server (it has been configured to read from www and listen to port 8080)
  6. Navigate to http://localhost:8080 on a browser or run curl http://localhost:8080 from the command line

About

A simple HTTP web server implemented in Java.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors