get '/:database/_design/:design/_view/:view' => sub {
my $self = shift;
- my $url = $self->param('url');
- my $param = $self->req->url->query->to_string;
- warn "# /couchdb $url ",
- _render_jsonp( $self, _couchdb_get(
- $self->param('database') . '/_design/' . $self->param('design') . '/_view/' . $self->param('view')
- . ( $param ? '?'.$param : '' )
- ));
+ my $url = join('/', $self->param('database'),'_design',$self->param('design'),'_view',$self->param('view') );
+ my $param = $self->req->url->query->clone->remove('callback')->to_string;
+ $url .= '?' . $param if $param;
+ warn "CouchDB proxy $url";
+ _render_jsonp( $self, _couchdb_get($url));
};
app->start;
console.debug( self.$xhr );
self.$xhr("JSON"
- , "http://localhost:5984/conference/_design/symposium/_view/works?callback=JSON_CALLBACK;key=" + s_id
+ , "/conference/_design/symposium/_view/works?callback=JSON_CALLBACK;key=" + s_id
, function(code, response){
console.log('symposium/_view/works', code, response);
angular.foreach( response.rows, function(row) {