Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'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));
};
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));
};
'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));
};
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
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'));
'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);
};
'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));
};
'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));
};
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));
};
'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));
};