Jetty 12 - Server/Handler DSL
- Dominant language
- Java
- Stars
- 4.1k
- Forks
- 2k
- Avg merge
- 3d 56m
- Merged PRs (30d)
- 48
Description
**Jetty version(s)**
12+
**Enhancement Description**
The idea is to provide an easy to use, almost single-line, builder-like, DSL to build a `Server` instance and map HTTP methods and paths to Java method references.
Just syntactic sugar, but sometimes easier than figuring out what to write the next line, because an IDE will prompt what is available, and it's easier to pick `.listen()`, or `.route()`.
A mocked API could be:
```java
Server
.listen(8080, new HttpConnectionFactory())
.listen(8443, )
.routes()
.route(HttpMethod.GET, "/welcome", this::welcome)
.route(HttpMethod.POST, "/form", this::handleFormUpload)
.build()
.build()
.start();
```
Contributor guide
Research direction
Start by reviewing Jetty's existing Server and Handler APIs and the issue's proposed listen(), route(), build(), and start() entry points. The issue does not name implementation files or tests, so first establish the DSL's scope and API design before identifying the affected modules. Done would require an agreed builder-style design for mapping HTTP methods and paths to Java method references.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100