3.11. HTTP Resource Handlers¶
3.11.1. Global HTTP Handlers¶
- [httpd_global_handlers]¶
These HTTP resources are provided for CouchDB server root level.
- /¶
[httpd_global_handlers] / = {couch_httpd_misc_handlers, handle_welcome_req, <<"Welcome">>}
- favicon.ico¶
The favicon handler looks for favicon.ico file within specified directory:
[httpd_global_handlers] favicon.ico = {couch_httpd_misc_handlers, handle_favicon_req, "/usr/share/couchdb/www"}
- _active_tasks¶
[httpd_global_handlers] _active_tasks = {couch_httpd_misc_handlers, handle_task_status_req}
- _all_dbs¶
Provides a list of all server’s databases:
[httpd_global_handlers] _all_dbs = {couch_httpd_misc_handlers, handle_all_dbs_req}
Note
Sometimes you don’t want to disclose database names for everyone, but you also don’t like/want/able to set up any proxies in front of CouchDB. Removing this handler disables _all_dbs resource and there will be no way to get list of available databases.
The same also is true for other resource handlers.
- _config¶
Provides resource to work with CouchDB config remotely. Any config changes that was made via HTTP API are applied automatically on fly and doesn’t requires server instance to be restarted:
[httpd_global_handlers] _config = {couch_httpd_misc_handlers, handle_config_req}
- _replicate¶
Provides an API to run temporary replications:
[httpd_global_handlers] _replicate = {couch_replicator_httpd, handle_req}
- _restart¶
Provides an API to restart CouchDB (only on the node-local port).
[httpd_global_handlers] _restart = {couch_httpd_misc_handlers, handle_restart_req}
- _session¶
Provides a resource with information about the current user’s session:
[httpd_global_handlers] _session = {couch_httpd_auth, handle_session_req}
- _stats¶
[httpd_global_handlers] _stats = {couch_httpd_stats_handlers, handle_stats_req}
- _utils¶
The _utils handler serves Fauxton‘s web administration page:
[httpd_global_handlers] _utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "/usr/share/couchdb/www"}
In similar way, you may set up custom handler to let CouchDB serve any static files.
- _uuids¶
Provides a resource to get UUIDs generated by CouchDB:
[httpd_global_handlers] _uuids = {couch_httpd_misc_handlers, handle_uuids_req}
This is useful when your client environment isn’t capable of providing truly random IDs (web browsers e.g.).
3.11.2. Database HTTP Handlers¶
- [httpd_db_handlers]¶
These HTTP resources are available on every CouchDB database.
- _all_docs¶
[httpd_db_handlers] _all_docs = {couch_mrview_http, handle_all_docs_req}
- _local_docs¶
[httpd_db_handlers] _local_docs = {couch_mrview_http, handle_local_docs_req}
- _design_docs¶
[httpd_db_handlers] _design_docs = {couch_mrview_http, handle_design_docs_req}
- _changes¶
[httpd_db_handlers] _changes = {couch_httpd_db, handle_changes_req}
- _compact¶
[httpd_db_handlers] _compact = {couch_httpd_db, handle_compact_req}
- _design¶
[httpd_db_handlers] _design = {couch_httpd_db, handle_design_req}
- _view_cleanup¶
[httpd_db_handlers] _view_cleanup = {couch_mrview_http, handle_cleanup_req}
3.11.3. Design Documents HTTP Handlers¶
- [httpd_design_handlers]¶
These HTTP resources are provided for design documents.
- _compact¶
[httpd_design_handlers] _compact = {couch_mrview_http, handle_compact_req}
- _info¶
[httpd_design_handlers] _info = {couch_mrview_http, handle_info_req}
- _list¶
[httpd_design_handlers] _list = {couch_mrview_show, handle_view_list_req}
- _rewrite¶
[httpd_design_handlers] _rewrite = {couch_httpd_rewrite, handle_rewrite_req}
- _show¶
[httpd_design_handlers] _show = {couch_mrview_show, handle_doc_show_req}
- _update¶
[httpd_design_handlers] _update = {couch_mrview_show, handle_doc_update_req}
- _view¶
[httpd_design_handlers] _view = {couch_mrview_http, handle_view_req}