How to use jovo-framework - 10 common examples

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-framework / examples / javascript / unit-testing / src / index.js View on Github external
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 / 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-framework / examples / javascript / language-model-tester / src / app.js View on Github external
const { App, Util } = require('jovo-framework');
const { GoogleAssistant } = require('jovo-platform-googleassistant');
const { Alexa } = require('jovo-platform-alexa');
const { JovoDebugger } = require('jovo-plugin-debugger');
const { FileDb } = require('jovo-db-filedb');
const { LanguageModelTester } = require('jovo-plugin-lmtester');

const app = new App();
// Util.consoleLog();

app.use(
    new GoogleAssistant(),
    new Alexa(),
    new JovoDebugger(),
    new FileDb(),
    new LanguageModelTester(),
);

app.setHandler({
    async LAUNCH() {
        return this.toIntent('HelloWorldIntent');
    },
    HelloWorldIntent() {
        this
github jovotech / jovo-framework / examples / javascript / i18n / src / app.js View on Github external
const { App, Util } = require('jovo-framework');
const { GoogleAssistant } = require('jovo-platform-googleassistant');
const { Alexa } = require('jovo-platform-alexa');
const { JovoDebugger } = require('jovo-plugin-debugger');
const { FileDb } = require('jovo-db-filedb');

const app = new App();


app.use(
    new GoogleAssistant(),
    new Alexa(),
    new JovoDebugger(),
    new FileDb(),
);


app.setHandler({
    LAUNCH() {
        // this.$speech.t('WELCOME_ARRAY');
        // return this.tell(this.$cms.resources);
        console.log(this.t('WELCOME_GLOBAL'));
        this.tell(this.t('WELCOME'));
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));
};

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