MCPcopy Create free account
hub / github.com/3rdparty/libprocess / provide

Method provide

include/process/process.hpp:376–387  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected