0.0.7 • Published 5 years ago

@viq/functions v0.0.7

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

Cloud Functions | viq.app

Package to create and use viq.app cloud functions

Installation

In your project directory run:

# using yarn
$ yarn add @viq/functions

# using npm
$ npm install @viq/functions

Usage

const functions = require('@viq/functions');

// Express-style request accepting all HTTP methods
functions.path('/helloWorld').onReq((req, res) => {
  res.send('Hello world');
});

// Adding middleware
const someMiddleware = (req, res, next) => {
  req.foo = 'bar';
};

functions
  .path('/foo')
  .mid(someMiddleware)
  .onReq((req, res) => {
    res.send(req.foo); // => 'bar'
  });

module.exports = functions;
0.0.7

5 years ago

0.0.6

5 years ago

0.0.3

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.2

6 years ago

0.0.1

6 years ago