Skip to content

Instantly share code, notes, and snippets.

View ekpangmichael's full-sized avatar

Ekpang Michael ekpangmichael

View GitHub Profile
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 8.x]
on:
push:
branches:
- master
@ekpangmichael
ekpangmichael / ci.yml
Last active September 26, 2019 08:32
A sample github ci/cd workflow
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
class WhatsappBot {
/**
* @memberof WhatsappBot
* @param {object} req - Request sent to the route
* @param {object} res - Response sent from the controller
* @param {object} next - Error handler
* @returns {object} - object representing response message
*/
static async googleSearch(req, res, next) {
const twiml = new MessagingResponse();
const {
SID: accountSid,
KEY: TwilloAuthToken,
APIKEY: googleApiKey,
CX: cx
} = process.env;
twilio(accountSid, TwilloAuthToken);
const { MessagingResponse } = twilio.twiml;
const customsearch = google.customsearch('v1');
import { google } from 'googleapis';
import dotenv from 'dotenv';
import twilio from 'twilio';
dotenv.config();
{
"presets": ["@babel/preset-env"]
}
{
"presets": ["@babel/preset-env"]
}
import { Router } from 'express';
import botRouter from './search';
const v1Router = Router();
v1Router.use('/api/v1', botRouter);
export default v1Router;
import { Router } from 'express';
import WhatsappBot from '../controllers/WhatsappBot';
const botRouter = Router();
botRouter.post('/incoming', WhatsappBot.googleSearch);
export default botRouter;