Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Binaris is a fast, low-latency FaaS (Function as a Service) platform. With our performance and scale, you can run real production workloads on Node.js.
npm install -g binaris
Setup Binaris credentials
Generate a Binaris template function
# generates simple NodeJS template function
bn create node8 hellofunc
# makes the function available via Binaris cloud
bn deploy hellofunc
# calls the function endpoint via https
bn invoke hellofunc
git diff
--- a/function.js
+++ b/function.js
- console.log('Hello World');
+ console.log('Hello Binaris');
# redeploy the function
bn deploy hellofunc
bn logs hellofunc
It's as simple as that.
There's a docker version of the Binaris CLI, published on Dockerhub as binaris/bn.
To run in the current directory:
docker run --rm -v $(pwd):/src binaris/bn --help
You'll want to forward your API key. So add -e BINARIS_API_KEY
like so:
docker run --rm -e BINARIS_API_KEY -v $(pwd):/src binaris/bn
For convenience, you can create an alias for this in bash:
alias bn='docker run --rm -e BINARIS_API_KEY -v $(pwd):/src binaris/bn'
bn create node8 hello
bn deploy hello
bn invoke hello
You can pass configuration parameters to functions as part of the deploy
command. These parameters will be available to the function during runtime as environment variables. All parameters are encrypted at rest and in-transit, which makes them the preferred way to store API keys, passwords, etc.
To pass parameters into a function, add an env:
section to binaris.yml
, like so:
functions:
hello:
file: function.js
entrypoint: handler
runtime: node8
env:
SOME_API_KEY: XXXXXXXXXXX
If a parameter is sensitive and you don't want to commit it to SCM, you can leave out the value in binaris.yml
:
functions:
hello:
file: function.js
entrypoint: handler
runtime: node8
env:
SOME_API_KEY:
And pass it as an environment variable to the deploy
command:
You can then access these parameters as environment variables:
function.js
exports.handler = () => {
const apiKey = process.env.SOME_API_KEY;
// ...
}
Or in Python:
import os
def handler(body, req):
apiKey = os.environ['SOME_API_KEY']
# ...
Only string values are supported in the env:
section.
SOME_API_KEY=XXXXXXX bn deploy hello
Learn more about the Binaris platform at the developer resources page.
This project is licensed under the terms of the MIT license
FAQs
Binaris SDK & CLI
The npm package binaris receives a total of 44 weekly downloads. As such, binaris popularity was classified as not popular.
We found that binaris demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.