How to use the jovo-framework.Webhook.listen function in jovo-framework

To help you get started, we’ve selected a few jovo-framework examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jovotech / jovo-framework / examples / javascript / unit-testing / src / index.js View on Github external
'use strict';

const {
    Webhook,
    ExpressJS,
    Lambda
} = require('jovo-framework');

const {app} = require('./app.js');

if (process.argv.indexOf('--webhook') > -1) {
    const port = process.env.PORT || 3000;
    Webhook.jovoApp = app;
    Webhook.listen(port, () => {
        console.info(`Local server listening on port ${port}!`);
    });

    Webhook.post('/webhook', async (req, res) => {
        await app.handle(new ExpressJS(req, res));
    });
}

// AWS Lambda
exports.handler = async (event, context, callback) => {
    await app.handle(new Lambda(event, context, callback));
};
github jovotech / jovo-sample-voice-app-nodejs / index.js View on Github external
'use strict';

const {Webhook} = require('jovo-framework');
const {app} = require('./app/app.js');

// =================================================================================
// Server Configuration
// =================================================================================

if (app.isWebhook()) {
    const port = process.env.PORT || 3000;
    Webhook.listen(port, () => {
        console.log(`Example server listening on port ${port}!`);
    });
    Webhook.post('/webhook', (req, res) => {
        app.handleWebhook(req, res);
    });
}

exports.handler = (event, context, callback) => {
    app.handleLambda(event, context, callback);
};
github jovotech / jovo-sample-voice-app-nodejs / src / index.js View on Github external
'use strict';

const { Webhook, ExpressJS, Lambda } = require('jovo-framework');
const { app } = require ('./app.js');

// ------------------------------------------------------------------
// HOST CONFIGURATION
// ------------------------------------------------------------------

// ExpressJS (Jovo Webhook)
if (process.argv.indexOf('--webhook') > -1) {
    const port = process.env.JOVO_PORT || 3000;
    Webhook.jovoApp = app;

    Webhook.listen(port, () => {
        console.info(`Local server listening on port ${port}.`);
    });

    Webhook.post('/webhook', async (req, res) => {
        await app.handle(new ExpressJS(req, res));
    });
}

// AWS Lambda
exports.handler = async (event, context, callback) => {
    await app.handle(new Lambda(event, context, callback));
};
github jovotech / jovo-framework / examples / 01_alexa / audioplayer / src / index.js View on Github external
'use strict';

const {
    Webhook,
    ExpressJS,
    Lambda
} = require('jovo-framework');

const {app} = require('./app.js');

if (process.argv.indexOf('--webhook') > -1) {
    const port = process.env.PORT || 3000;
    Webhook.jovoApp = app;
    Webhook.listen(port, () => {
        console.info(`Local server listening on port ${port}!`);
    });

    Webhook.post('/webhook', async (req, res) => {
        await app.handle(new ExpressJS(req, res));
    });
}

// AWS Lambda
exports.handler = async (event, context, callback) => {
    await app.handle(new Lambda(event, context, callback));
};
github jovotech / jovo-framework / examples / typescript / 01_alexa / audioplayer / src / index.ts View on Github external
import { Webhook, ExpressJS, Lambda } from 'jovo-framework';

const {app} = require('./app.js');

if (process.argv.indexOf('--webhook') > -1) {
    const port = process.env.PORT || 3000;
    Webhook.jovoApp = app;
    Webhook.listen(port, () => {
        console.info(`Local server listening on port ${port}!`);
    });

    Webhook.post('/webhook', async (req: any, res: any) => { // tslint:disable-line
        await app.handle(new ExpressJS(req, res));
    });
}

// AWS Lambda
export const handler = async (event: any, context: any, callback: Function) => { // tslint:disable-line
    await app.handle(new Lambda(event, context, callback));
};
github jovotech / jovo-framework / examples / javascript / 01_alexa / geolocation / src / index.js View on Github external
'use strict';

const { Webhook, ExpressJS, Lambda } = require('jovo-framework');
const { app } = require('./app.js');

// ------------------------------------------------------------------
// HOST CONFIGURATION
// ------------------------------------------------------------------

// ExpressJS (Jovo Webhook)
if (process.argv.indexOf('--webhook') > -1) {
    const port = process.env.JOVO_PORT || 3000;
    Webhook.jovoApp = app;

    Webhook.listen(port, () => {
        console.info(`Local server listening on port ${port}.`);
    });

    Webhook.post('/webhook', async (req, res) => {
        await app.handle(new ExpressJS(req, res));
    });
}

// AWS Lambda
exports.handler = async (event, context, callback) => {
    await app.handle(new Lambda(event, context, callback));
};
github jovotech / jovo-framework / examples / typescript / 01_alexa / apl / src / index.ts View on Github external
import { Webhook, ExpressJS, Lambda } from 'jovo-framework';

const {app} = require('./app.js');

if (process.argv.indexOf('--webhook') > -1) {
    const port = process.env.PORT || 3000;
    Webhook.jovoApp = app;
    Webhook.listen(port, () => {
        console.info(`Local server listening on port ${port}!`);
    });

    Webhook.post('/webhook', async (req: any, res: any) => { // tslint:disable-line
        await app.handle(new ExpressJS(req, res));
    });
}

// AWS Lambda
export const handler = async (event: any, context: any, callback: Function) => { // tslint:disable-line
    await app.handle(new Lambda(event, context, callback));
};
github jovotech / jovo-framework / examples / javascript / hello-world / src / index.js View on Github external
'use strict';
const {
    Webhook,
    ExpressJS,
    Lambda
} = require('jovo-framework');

const {app} = require('./app.js');

if (process.argv.indexOf('--webhook') > -1) {
    const port = process.env.JOVO_PORT || 3000;
    Webhook.jovoApp = app;
    Webhook.listen(port, () => {
        console.info(`Local server listening on port ${port}!`);
    });

    Webhook.post('/webhook', async (req, res) => {
        await app.handle(new ExpressJS(req, res));
    });
}

// AWS Lambda
exports.handler = async (event, context, callback) => {
    await app.handle(new Lambda(event, context, callback));
};
github jovotech / jovo-framework / examples / 02_googleassistant / ask-for-x / src / index.js View on Github external
'use strict';

const {
    Webhook,
    ExpressJS,
    Lambda
} = require('jovo-framework');

const {app} = require('./app.js');

if (process.argv.indexOf('--webhook') > -1) {
    const port = process.env.PORT || 3000;
    Webhook.jovoApp = app;
    Webhook.listen(port, () => {
        console.info(`Local server listening on port ${port}!`);
    });

    Webhook.post('/webhook', async (req, res) => {
        await app.handle(new ExpressJS(req, res));
    });
}

// AWS Lambda
exports.handler = async (event, context, callback) => {
    await app.handle(new Lambda(event, context, callback));
};
github jovotech / jovo-framework / examples / 01_alexa / video-app / src / index.js View on Github external
'use strict';

const {
    Webhook,
    ExpressJS,
    Lambda
} = require('jovo-framework');

const {app} = require('./app.js');

if (process.argv.indexOf('--webhook') > -1) {
    const port = process.env.PORT || 3000;
    Webhook.jovoApp = app;
    Webhook.listen(port, () => {
        console.info(`Local server listening on port ${port}!`);
    });

    Webhook.post('/webhook', async (req, res) => {
        await app.handle(new ExpressJS(req, res));
    });
}

// AWS Lambda
exports.handler = async (event, context, callback) => {
    await app.handle(new Lambda(event, context, callback));
};

jovo-framework

[![Jovo Framework](https://github.com/jovotech/jovo-framework/raw/master/docs/img/jovo-header.jpg)](https://v3.jovo.tech)

Apache-2.0
Latest version published 2 years ago

Package Health Score

58 / 100
Full package analysis

Similar packages