addServlet

fun addServlet(path: String, servlet: HttpServlet)

Registers a single 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 HttpServlet instance to register.