JExpress.java, a light and slow express.js clone written in Java 25 (in one file). It uses virtual threads with its own single-thread scheduled (using Unsafe hence the warnings at start-up).
There is also JExpress17.java, a version backward compatible with Java 17 (supports JSON <-> record mapping). There is also JExpress8.java, a version backward compatible with Java 8.
- JExpress: express(), get(path, callback), post(path, callback), put(path, callback), delete(path, callback), use(path, handler), listen(port) and staticFiles(root).
 - Request: bodyArray(), bodyObject(), bodyText(), get(header), method(), param(name) and path().
 - Response: status(status), type(type, charset), set(field, value), append(field, value), json(object), send(body) and sendFile(path).
 
The full javadoc
public static void main(String[] args) {
  var app = express();
  app.use(staticFiles(Path.of("public")));
  app.get("/hello/:id", (req, res) -> {
    var id = req.param("id");
    record Hello(String id) {}
    res.json(new Hello(id));
  });
  
  app.get("/LICENSE", (req, res) -> {
    res.sendFile(Path.of("LICENSE"));
  });
  app.listen(3000);
}- 
Run the application with Java 25
cd src/main/java java JExpress.java - 
Test the application with Maven
mvn clean package