https://github.com/wmartinmimi/lil-http-server4j
Not-for-production experimental java http server using virtual threads
https://github.com/wmartinmimi/lil-http-server4j
experimental http-server java mit-license virtual-threads
Last synced: 11 months ago
JSON representation
Not-for-production experimental java http server using virtual threads
- Host: GitHub
- URL: https://github.com/wmartinmimi/lil-http-server4j
- Owner: wmartinmimi
- License: mit
- Created: 2023-07-03T10:44:40.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-15T09:43:26.000Z (almost 3 years ago)
- Last Synced: 2025-03-27T08:22:07.655Z (about 1 year ago)
- Topics: experimental, http-server, java, mit-license, virtual-threads
- Language: Java
- Homepage:
- Size: 75.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# lil-http-server4j
An experimental http server for utilising virtual thread features.
## IMPORTANT!
Not for production uses!
## Example Usage
```java
class Main {
public static void main(String[] args) throws IOException {
try (var server = new HttpRequestHandler(20000)) {
server.setHttpRequestListener((request) -> switch (request.path()) {
case "/hello" -> new HttpResponses.Status200("text/plain-text", "hello");
case "/bye" -> new HttpResponses.Status204();
default -> new HttpResponses.Status404("text/plain-text", "404 error");
});
server.run();
}
}
}
```
- [Example Usage 1](https://github.com/wmartinmimi/lil-http-server4j/blob/main/lib/src/test/java/io/githubb/wmartinmimi/lilhttpserver4j/ExampleUsage1.java)
## Features
- Uses Virtual Threads
## Testing and Running Requirements
- JDK version 20+
## Importing Requirements
- org.slf4j library
- Testing and Running requirements
## Development
### Testing
```shell
./gradlew test
```
### Building
```shell
./gradlew build
```
## License
Licensed under ```MIT License```