| // Copyright 2014 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| module http_server; |
| |
| import "services/http_server/public/http_request.mojom"; |
| import "services/http_server/public/http_response.mojom"; |
| |
| interface HttpServer { |
| // Set a handler for URLs mathing a regex pattern. Handlers are considered in |
| // the order they were registered. |
| // |
| // Returns false if there was already a handler registered for the given |
| // pattern. |
| // |
| // To unregister a handler, destroy the underlying pipe. |
| SetHandler(string pattern, HttpHandler handler) => (bool success); |
| }; |
| |
| interface HttpHandler { |
| HandleRequest(HttpRequest request) => (HttpResponse response); |
| }; |