- configure Apache (apache_home/conf/httpd.conf)
- uncomment
LoadModule proxy_module modules/mod_proxy.so
- uncomment
LoadModule proxy_http_module modules/mod_proxy_http.so
- add
ProxyPass /couchdb http://127.0.0.1:5984
(as top level property like ServerAdmin) - restart Apache
- uncomment
- modify index.html
- replace
http.open('GET', 'http://127.0.0.1:5984/_all_dbs', true);
withhttp.open('GET', '/couchdb/_all_dbs', true);
- replace
I can execute some simple database commands as described in the Definitive Guide, replacing curl with some JavaScript code:
<html>
<head>
<script type="text/javascript">
function initialize() {
request=new XMLHttpRequest();
request.open('GET','http://127.0.0.1/couchdb/_all_dbs',true);
request.send(null);
request.onreadystatechange = function() {
if (request.readyState == 4) {
if (request.status == 200) {
alert(request.responseText);
}
}
};
}
</script>
</head>
<body onload="initialize()">
</body>
</html>
No comments:
Post a Comment