This repository has been archived by the owner on Feb 4, 2020. It is now read-only.
forked from austinfrey/node-openfaas
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated README. Now uses
openfaas
instead of faas
Signed-off-by: austinfrey <[email protected]>
- Loading branch information
1 parent
d52861b
commit fa28bae
Showing
10 changed files
with
188 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
[![XO code | ||
style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) | ||
![OpenFaaS](https://img.shields.io/badge/openfaas-serverless-blue.svg) | ||
|
||
##### Usage | ||
|
||
Add `openfaas` via `npm` | ||
|
||
``` | ||
$ npm install openfaas --save | ||
``` | ||
|
||
Example usage | ||
|
||
``` | ||
const OpenFaaS = require('./openfaas') | ||
const openfaas = OpenFaaS('http://localhost:8080') | ||
openfaas.deploy( | ||
'yolo', // name your function | ||
'func_functions, // choose your network | ||
'hello-serverless // choose the Docker image | ||
) | ||
.then(x => console.log(x)) | ||
.catch(err => console.log(err)) | ||
openfaas.invoke( | ||
'yolo', // function name | ||
'hello world', // data to send to function | ||
true //should response be JSON? optional. default is false | ||
) | ||
.then(x => console.log(x)) // handle response | ||
.catch(err => console.log(err)) | ||
openfaas.remove('yolo') | ||
.then(x => console.log(x)) // handle response | ||
.catch(err => console.log(err)) | ||
openfaas.compose('initial data', [ | ||
'func_nodeinfo', | ||
'func_echoit', | ||
'func_wordcount' | ||
] | ||
) | ||
.then(x => console.log(x.body)) // handle final output | ||
.catch(err => console.log(err)) | ||
``` | ||
|
||
##### ToDo | ||
* Complete tests | ||
* support additional request options for `got` |
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 |
---|---|---|
@@ -1,12 +1,4 @@ | ||
const Faas = require('./faas'); | ||
'use strict'; | ||
|
||
const faas = Faas('http://localhost:8080'); | ||
|
||
faas.deploy( | ||
'yolo', | ||
'func_functions', | ||
'hello-serverless' | ||
) | ||
.then(x => console.log(x)) | ||
.catch(err => console.log(err)); | ||
module.exports = require('./openfaas'); | ||
|
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,19 +1,33 @@ | ||
{ | ||
"name": "open-faas", | ||
"version": "0.0.1", | ||
"description": "", | ||
"name": "openfaas", | ||
"version": "0.0.4", | ||
"description": "NodeJS wrapper around the OpenFaaS Gateway API w/ some additional helper functions", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "node test", | ||
"lint": "xo --fix" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"author": "Austin Frey", | ||
"license": "MIT", | ||
"dependencies": { | ||
"bluebird": "^3.5.0", | ||
"got": "^7.1.0" | ||
}, | ||
"devDependencies": { | ||
"nock": "^9.0.20", | ||
"tape": "^4.8.0", | ||
"xo": "^0.18.2" | ||
} | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/austinfrey/node-openfaas.git" | ||
}, | ||
"keywords": [ | ||
"serverless", | ||
"FaaS" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/austinfrey/node-openfaas/issues" | ||
}, | ||
"homepage": "https://github.com/austinfrey/node-openfaas#readme" | ||
} |
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