Skip to content

Commit

Permalink
Fix #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Aglezabad committed Mar 6, 2017
1 parent 79ed383 commit 017613a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,5 @@ and licensed under:
- The incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://opensource.org/licenses/mit-license.php)

<!-- /LICENSE -->


4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"version": "2.1.0",
"description": "DocPad plugin that inyects your custom REST api inside a site built with Docpad.",
"homepage": "https://github.com/univunix/docpad-plugin-api",
"license": "MIT",
"license": {
"type": "MIT"
},
"keywords": [
"docpad",
"docpad-plugin",
Expand Down
6 changes: 3 additions & 3 deletions src/api.plugin.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module.exports = (BasePlugin) ->
config:
baseApiUrl: '/api'
source: [
uri: '',
uri: ''
file: '',
file: ''
]

serverExtend: (opts) ->
Expand All @@ -21,7 +21,7 @@ module.exports = (BasePlugin) ->
rootPath = docpad.getConfig().rootPath
customApis = []
for src in @config.source
customApis.push(require(path.join(rootPath, src.uri)))
customApis.push(require(path.join(rootPath, src.file)))

# Default route.
server.get "#{@config.baseApiUrl}/engine/version", (req, res, next) ->
Expand Down
2 changes: 1 addition & 1 deletion test/docpad.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ docpadConfig = {
api:
baseApiUrl: '/APIURLTEST'
source: [
uri: 'api/api-test.js'
file: 'api/api-test.js'
]
}

Expand Down

0 comments on commit 017613a

Please sign in to comment.