addServlet

fun addServlet(path: String, servlet: Servlet)

Registers a servlet at the given URL path. Paths that are empty or blank are silently ignored, and a leading slash is added when missing, so "ping" and "/ping" are the same endpoint.

Parameters

path

The URL path to map the servlet to.

servlet

The Servlet instance to register.