mountOn method

void mountOn(
  1. Router router
)

Registra todos os endpoints no router.

Implementation

void mountOn(Router router) {
  for (final ep in endpoints) {
    final h = _handlerFor(ep);
    switch (ep.method) {
      case HttpMethod.get:
        router.get(ep.path, h);
      case HttpMethod.post:
        router.post(ep.path, h);
      case HttpMethod.put:
        router.put(ep.path, h);
      case HttpMethod.delete:
        router.delete(ep.path, h);
    }
  }
}