Skip to content

Commit

Permalink
when register function in function object allow all type of callback …
Browse files Browse the repository at this point in the history
…i.e (function, array or an express router or app
  • Loading branch information
joshuamshana committed Nov 1, 2019
1 parent 65f50e9 commit 7cf9e8e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
12 changes: 11 additions & 1 deletion .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bfastfunction",
"version": "1.7.1-alpha",
"version": "1.7.2",
"private": true,
"scripts": {
"start": "node src/index.js",
Expand Down
6 changes: 3 additions & 3 deletions src/faas.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ _app.use('/names', function (request, response) {
_faaSController.getFunctions().then(functions => {
if (typeof functions === 'object') {
Object.keys(functions).forEach(functionName => {
if (typeof functions[functionName] === 'function') {
_app.use(`/functions/${functionName}`, functions[functionName]);
}
// if (typeof functions[functionName] === 'function' || Array.isArray(functions[functionName])) {
_app.use(`/functions/${functionName}`, functions[functionName]);
// }
});
} else {
throw {message: 'It\'s not object'};
Expand Down

0 comments on commit 7cf9e8e

Please sign in to comment.