Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/limium/picoserve
Compact, Simple HTTP server for Java
https://github.com/limium/picoserve
http-server java
Last synced: about 1 month ago
JSON representation
Compact, Simple HTTP server for Java
- Host: GitHub
- URL: https://github.com/limium/picoserve
- Owner: LiMium
- License: apache-2.0
- Created: 2021-04-12T11:53:58.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-18T13:29:30.000Z (almost 4 years ago)
- Last Synced: 2024-11-05T12:22:14.704Z (3 months ago)
- Topics: http-server, java
- Language: Java
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# picoServe
* A very simple HTTP server library,
* written in pure Java with zero dependencies,
* based on `com.sun.net.httpserver.HttpServer`,
* ready for Project Loom, by specifying an appropriate executor (see `Example.java`)
* a convenient builder with conveniences for
* request parameters
* response headers
* string and byte array responses## Quick start
```java
Server.builder()
.port(9000)
.backlog(5)
.GET("/string", request -> {
return new StringResponse(200, "hello " + request.getQueryParams());
})
.build()
.start();
```## Example
See the file `Example.java` for different variations of usage.