Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions nodejs/collection/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ express.bodyParser.parse['application/collection+json'] = JSON.parse;
/* handle default task list */
app.get('/collection/tasks/', function(req, res){

var view = '/_design/example/_view/due_date';
var view = '_design/example/_view/due_date';

db.get(view, function (err, doc) {
res.header('content-type',contentType);
Expand Down Expand Up @@ -72,7 +72,7 @@ app.get('/collection/tasks/;template', function(req, res){

app.get('/collection/tasks/;all', function(req, res){

var view = '/_design/example/_view/all';
var view = '_design/example/_view/all';

db.get(view, function (err, doc) {
res.header('content-type',contentType);
Expand All @@ -85,7 +85,7 @@ app.get('/collection/tasks/;all', function(req, res){

app.get('/collection/tasks/;open', function(req, res){

var view = '/_design/example/_view/open';
var view = '_design/example/_view/open';

db.get(view, function (err, doc) {
res.header('content-type',contentType);
Expand All @@ -98,7 +98,7 @@ app.get('/collection/tasks/;open', function(req, res){

app.get('/collection/tasks/;closed', function(req, res){

var view = '/_design/example/_view/closed';
var view = '_design/example/_view/closed';

db.get(view, function (err, doc) {
res.header('content-type',contentType);
Expand All @@ -118,7 +118,7 @@ app.get('/collection/tasks/;date-range', function(req, res){
options.startkey=String.fromCharCode(34)+d1+String.fromCharCode(34);
options.endkey=String.fromCharCode(34)+d2+String.fromCharCode(34);

var view = '/_design/example/_view/due_date';
var view = '_design/example/_view/due_date';

db.get(view, options, function (err, doc) {
res.header('content-type',contentType);
Expand All @@ -133,7 +133,7 @@ app.get('/collection/tasks/;date-range', function(req, res){
/* handle single task item */
app.get('/collection/tasks/:i', function(req, res){

var view = '/'+req.params.i;
var view = req.params.i;

db.get(view, function (err, doc) {
res.header('content-type',contentType);
Expand Down