* Sets up the default HTTP request handler to provide the static * asset(s) at the specified _absolute_ path for the specified name. * * For example, assuming the process named "server" invoked * `provide("name", "path")`, then an HTTP request for `/server/name` * would return the asset found at "path". If the specified path is a * directory then an HTTP request for `/server/name
| 374 | * the optional `types` parameter. |
| 375 | */ |
| 376 | void provide( |
| 377 | const std::string& name, |
| 378 | const std::string& path, |
| 379 | const std::map<std::string, std::string>& types = mime::types) |
| 380 | { |
| 381 | // TODO(benh): Check that name is only alphanumeric (i.e., has no |
| 382 | // '/') and that path is absolute. |
| 383 | Asset asset; |
| 384 | asset.path = path; |
| 385 | asset.types = types; |
| 386 | assets[name] = asset; |
| 387 | } |
| 388 | |
| 389 | /** |
| 390 | * Returns the number of events of the given type currently on the |
nothing calls this directly
no outgoing calls
no test coverage detected