Giter Club home page Giter Club logo

dev-docs-content's Introduction

Binaris

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.

Getting up and running in seconds

  1. Install using npm
npm install -g binaris
  1. Setup Binaris credentials

    • If you already have an account it's as simple as exporting your existing credentials
    • Otherwise head over to Binaris to sign up
  2. Generate a Binaris template function

# generates simple NodeJS template function
bn create node12 hellofunc
  1. Deploy a function
# makes the function available via Binaris cloud
bn deploy hellofunc
  1. Invoke a function
# calls the function endpoint via https
bn invoke hellofunc
  1. Make changes to a function
git diff
--- a/function.js
+++ b/function.js

-    console.log('Hello World');
+    console.log('Hello Binaris');

# redeploy the function
bn deploy hellofunc
  1. Get logs for a function
bn logs hellofunc

It's as simple as that.

Running without Node & NPM

There's a docker version of the Binaris CLI, published on Dockerhub as binaris/bn.

Usage

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 node12 hello
bn deploy hello
bn invoke hello

Storing secrets and other configuration parameters

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: node12
    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: node12
    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

dev-docs-content's People

Contributors

avnerbraverman avatar foundingnimo avatar rylandg avatar

Watchers

 avatar  avatar

Forkers

rylandg

dev-docs-content's Issues

"Getting Started" should use relative links

Because "Getting Started" uses an absolute link:

[next sections](https://dev.reshuffle.app/running-locally)

it won't use react-router and therefore causes a full page reload. It should instead use a relative link.

[next sections](./running-locally)

"Getting Started" images are too small

Raised by a user, the direct quote:

I think these images are too small in this page. I understand what you guys are trying to do (display what the template home page/choices look like), but because the image is too small, it’s no very helpful.

The Pick a Template images should be scaled appropriately

Submitting a template has some holes

A user highlighted the holes in the "Submitting a Template to Reshuffle" page.

I would like to see more info as to the required structure of the tempalte_init_data.json, if there is any requirements. If there aren’t, I’d like to read that there aren’t :) (i.e. is a key called “items” required, or arbitrary? etc)

The template rules should be better fleshed out, and we shouldn't force the user to manually create a init_data.json file

Add TOC to the top of all pages with substantial content

A user suggested that we add a TOC to the top of "Getting Started". The suggested TOC contents were:

  1. Getting started
  2. Editing your app
  3. Deploying your app

They also suggested adding TOC's to other pages with significant length.

Add CTA "Next step" button on most pages

A user requested this, here is the full request

In the bottom, I would add a CTA button that says “Next step”, with an explanation. This should replace the text "In the next sections, we will cover editing your app and deploying it on Reshuffle.” - I would talk about all the sections here, just what’s up next (editing, in this case).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.