Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #1 from iamdustan/master

Adds support for express-resource routes
  • Loading branch information...
commit 6067ca678925e72be3d91ed542abd3415f4b51a5 2 parents e144788 + 0b5c3cd
Jim Snodgrass authored February 23, 2012

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. 7  index.js
7  index.js
@@ -109,9 +109,14 @@ Whisper.prototype.makeRequest = function(data, callback) {
109 109
       
110 110
       var url_pieces = basepath.split("/");
111 111
       var path_pieces = route.path.split("/");
  112
+      var express_resource_pieces = [];
  113
+
  114
+      if (path_pieces.length > 1 && path_pieces[1].match(/(.:format?)/)) {
  115
+        var express_resource_pieces = path_pieces[1].split('.');
  116
+      }
112 117
       
113 118
       // path arrays match
114  
-      if (url_pieces[1] == path_pieces[1]) {
  119
+      if (url_pieces[1] == path_pieces[1] || url_pieces[1] == express_resource_pieces[0] || path_pieces[0] == "*" ) {
115 120
         
116 121
         // fill out req params, body, query
117 122
         var req = {};

0 notes on commit 6067ca6

Please sign in to comment.
Something went wrong with that request. Please try again.