1.1.1 • Published 3 years ago

rbi-nodejs-agent v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Rebugit nodejs agent

Usage

Install

npm install rbi-nodejs-agent

Configure

Expressjs

Simple express server:

const {RebugitSDK} = require('rbi-nodejs-agent');
const express = require('express')
const app = express()
const port = 9000

const Rebugit = new RebugitSDK({
    apiKey: 'my-api-key',
})

app.use(Rebugit.Handlers().requestHandler())
app.post('/', (req, res) => {
    res.status(200).send({
        hello: 'world'
    })
})
app.use(Rebugit.Handlers().errorHandler({Sentry}))

app.listen(port, () => {
    console.log(`Example app listening at http://localhost:${port}`)
})

AWS Lambda

'use strict';

const {RebugitSDK} = require('rbi-nodejs-agent');

const rbi = new RebugitSDK({
    apiKey: 'your-api-key'
})

module.exports.getWeather = rbi.AWSLambda().lambdaHandler(async (event) => {
    const data = JSON.parse(event.body);
    
    return {
        statusCode: 200,
        body: "Hey, Hi Mark!",
        headers: {
            "Access-Control-Allow-Origin": "*"
        },
    };
})
1.1.1

3 years ago

1.1.0

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago