Permalink
Browse files

Add handler to return faked book results

  • Loading branch information...
evdb committed Dec 24, 2012
1 parent 2989141 commit a6542ba90043060ae4a878688a7913497913695d
Showing with 10 additions and 0 deletions.
  1. +10 −0 index.js
View
@@ -6,6 +6,16 @@ module.exports = function () {
var app = express();
+ // fake handler for the books endpoints
+ app.get("/books/:isbn", function (req, res) {
+ var isbn = req.param("isbn");
+ res.jsonp({
+ isbn: isbn,
+ title: "Title of " + isbn,
+ author: "Author of " + isbn,
+ });
+ });
+
// 404 everything
app.all("*", function (req, res) {
res.status(404);

0 comments on commit a6542ba

Please sign in to comment.