https://github.com/battila7/simple-http-server
From scratch HTTP server that serves static content from the disk.
https://github.com/battila7/simple-http-server
Last synced: about 1 month ago
JSON representation
From scratch HTTP server that serves static content from the disk.
- Host: GitHub
- URL: https://github.com/battila7/simple-http-server
- Owner: battila7
- Created: 2017-10-03T21:27:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-06T10:52:47.000Z (over 7 years ago)
- Last Synced: 2025-02-16T14:53:18.418Z (4 months ago)
- Language: Java
- Homepage:
- Size: 45.9 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple HTTP Server
An example of a simple **no-dependency** Java HTTP server written from scratch. It features a clean architecture and the basic feaures of an HTTP server/framework.
The server utilizes a thread pool, each connection is processed on a separate thread.
If you preferred the previous, even simpler version, head over here: https://github.com/battila7/simple-http-server/tree/0f4efb8af16fbb36b30f1d4549b08a003f814326
## What it is
* An HTTP server/framework that has no dependencies.
* A fun project.## What it isn't
* A production-ready HTTP server/framework.
* HTTP compliant.## How to run it?
The repository has two modules, of which the `example` module contains a simple application that responds with `Hello, World!` to all `GET` requests.
~~~~bash
mvn exec:java -pl example -Dexec.mainClass="simple.cli.Main" [-Dport=9090]
~~~~By default, the application will listen on port `9090`.
## Why did you write this?
I did not intend to, but I caught myself thinking about it, so I eventually gave in. Fortunately, it was fun.