Interface ApiModule.RouteHandler

Enclosing class:
ApiModule
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface ApiModule.RouteHandler
  • Method Summary

    Modifier and Type
    Method
    Description
    handle(String[] args, String ip)
     
  • Method Details

    • handle

      String handle(String[] args, String ip) throws Exception
      Parameters:
      args - URL segments that follow the route's base path, in order
      ip - Client IP — sourced from X-Real-IP header when behind a reverse proxy
      Returns:
      JSON string to send as the response body, or null to return a 400
      Throws:
      Exception - Any uncaught exception is caught by the server and returned as a JSON error