printRoutes method

void printRoutes()

Print out the registered routes to the console

Helpful to see whats available

Implementation

void printRoutes() {
  for (var route in routes) {
    late String methodString;
    switch (route.method) {
      case ServerUniverseMethodType.get:
        methodString = '\x1B[33mGET\x1B[0m';
        break;
      case ServerUniverseMethodType.post:
        methodString = '\x1B[31mPOST\x1B[0m';
        break;
      case ServerUniverseMethodType.put:
        methodString = '\x1B[32mPUT\x1B[0m';
        break;
      case ServerUniverseMethodType.delete:
        methodString = '\x1B[34mDELETE\x1B[0m';
        break;
      case ServerUniverseMethodType.patch:
        methodString = '\x1B[35mPATCH\x1B[0m';
        break;
      case ServerUniverseMethodType.options:
        methodString = '\x1B[36mOPTIONS\x1B[0m';
        break;
      case ServerUniverseMethodType.all:
        methodString = '\x1B[37mALL\x1B[0m';
        break;
      case ServerUniverseMethodType.head:
        methodString = '\x1B[38mHEAD\x1B[0m';
        break;
      case ServerUniverseMethodType.copy:
        methodString = '\x1B[39mCOPY\x1B[0m';
        break;
      case ServerUniverseMethodType.link:
        methodString = '\x1B[40mLINK\x1B[0m';
        break;
      case ServerUniverseMethodType.unlink:
        methodString = '\x1B[41mUNLINK\x1B[0m';
        break;
      case ServerUniverseMethodType.purge:
        methodString = '\x1B[42mPURGE\x1B[0m';
        break;
      case ServerUniverseMethodType.lock:
        methodString = '\x1B[43mUNLOCK\x1B[0m';
        break;
      case ServerUniverseMethodType.unlock:
        methodString = '\x1B[44mUNLOCK\x1B[0m';
        break;
      case ServerUniverseMethodType.propfind:
        methodString = '\x1B[45mPROPFIND\x1B[0m';
        break;
      case ServerUniverseMethodType.view:
        methodString = '\x1B[46mVIEW\x1B[0m';
        break;
    }
    print('${route.route} - $methodString');
  }
}