small medium large xlarge

Generic-user-small
08 Apr 2014, 15:23
Anthony Cervo (5 posts)

In chapter 6, I’ve successfully created a bundle using POST:

$ curl -X POST http://localhost:3000/api/bundle?name=War%20Books

I verified that it was created. In the next section, though, where we attempt to PUT a book with ID 132 (The Art of War), I get an error:

curl -X PUT http://localhost:3000/api/bundle/fcbc3c3d211bcd6d5415c490a1000a9a/book/132
{
  "error": "bad_gateway"
}

Any ideas?

Generic-user-small
15 Apr 2014, 14:25
Ellie @ Support (19 posts)

I will ping the author for you to take a look at the forums…

Avatar_pragsmall
17 Apr 2014, 21:40
Jim R. Wilson (69 posts)

Hi Anthony,

Sorry for the delay, been dealing with some family medical issues.

Does a regular GET request pull back the bundle that you created?

$ curl http://localhost:3000/api/bundle/fcbc3c3d211bcd6d5415c490a1000a9a

My guess is that the program is choking trying to look up the book with ID 132. That is, line 17 of bundle.js

What is your config.b4db set to? Make sure you can use curl to GET that book.

Generic-user-small
21 Apr 2014, 16:38
Anthony Cervo (5 posts)

Yes, I can get the bundle:

{
  "_id": "fcbc3c3d211bcd6d5415c490a1000a9a",
  "_rev": "1-d90a9d2a08880d9f29e6fa4515702d50",
  "type": "bundle",
  "name": "War Books",
  "books": {}
}

Avatar_pragsmall
26 May 2014, 11:16
Jim R. Wilson (69 posts)

My guess is the bad_gateway refers to reading book/132 from the books database. What is your config.b4db set to?

Generic-user-small
09 Oct 2014, 16:50
Theo Carper (3 posts)

Just in case someone else hits this issue, make sure the values in config have their trailing ‘/’

config = { bookdb: ‘http://localhost:5984/books/’, b4db: ‘http://localhost:5984/b4/’ };

  You must be logged in to comment