All Downloads are FREE. Search and download functionalities are using the official Maven repository.

le-annen.javaserver.0.1.source-code.Main Maven / Gradle / Ivy

Go to download

A minimal java http server which fulfills small portions of the http specifications. This is not a full fledged or secure server. It should only be used for learning purposes and contains no guarantees of any king.

The newest version!
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Main {
  public static void main(String[] args) {
    ExecutorService requestExecutor = Executors.newFixedThreadPool(10);
    ReadRequest readRequest = new ReadRequest();
    SendResponse sendResponse = new SendResponse();
    Router router = new Router();
    Logger logger = new Logger();

    Server httpServer = new Server(
            args,
            requestExecutor,
            readRequest,
            sendResponse,
            router,
            logger);

    Runtime.getRuntime().addShutdownHook(new ShutdownHook(httpServer, requestExecutor));

    httpServer.run();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy