forked from rendrjs/rendr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A cleaner way of supporting multiple API hosts
- Loading branch information
1 parent
2057e92
commit 4d5e611
Showing
14 changed files
with
132 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
var _ = require('underscore'), | ||
apiProxy = require('./../../../server/middleware/apiProxy'), | ||
should = require('should'); | ||
|
||
describe('apiProxy', function() { | ||
|
||
describe('getApiPath', function() { | ||
it('should support no separator', function() { | ||
should.equal(apiProxy.getApiPath("/some/path/to/resource"), "/some/path/to/resource"); | ||
}); | ||
|
||
it('should support a separator but no api name', function() { | ||
should.equal(apiProxy.getApiPath("/-/path/to/resource"), "/path/to/resource"); | ||
}); | ||
|
||
it('should support a separator with api name', function() { | ||
should.equal(apiProxy.getApiPath("/api-name/-/path/to/resource"), "/path/to/resource"); | ||
}); | ||
}); | ||
|
||
describe('getApiName', function() { | ||
it('should support no separator', function() { | ||
should.equal(apiProxy.getApiName("/some/path/to/resource"), null); | ||
}); | ||
|
||
it('should support a separator but no api name', function() { | ||
should.equal(apiProxy.getApiName("/-/path/to/resource"), null); | ||
}); | ||
|
||
it('should support a separator with api name', function() { | ||
should.equal(apiProxy.getApiName("/api-name/-/path/to/resource"), "api-name"); | ||
}); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters