RootHandler.cpp 731 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright 2016 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #include "tools/skiaserve/urlhandlers/UrlHandler.h"
  8. #include "microhttpd.h"
  9. #include "tools/skiaserve/Request.h"
  10. #include "tools/skiaserve/Response.h"
  11. using namespace Response;
  12. bool RootHandler::canHandle(const char* method, const char* url) {
  13. return 0 == strcmp(method, MHD_HTTP_METHOD_GET) &&
  14. 0 == strcmp(url, "/");
  15. }
  16. int RootHandler::handle(Request* request, MHD_Connection* connection,
  17. const char* url, const char* method,
  18. const char* upload_data, size_t* upload_data_size) {
  19. return SendTemplate(connection);
  20. }