An open API service indexing awesome lists of open source software.

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

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```