Skip to content

Instantly share code, notes, and snippets.

View ekpangmichael's full-sized avatar

Ekpang Michael ekpangmichael

View GitHub Profile
import request from "supertest";
import chaiHttp from "chai-http";
import chai, { expect } from "chai";
chai.use(chaiHttp);
const newUser = {
userName: "Ekpang Michael",
userEmail: "[email protected]",
userAddress: "Lagos",
{
"name": "whatsapp-bot",
"version": "1.0.0",
"description": "A whatspp bot that uses twilio ",
"main": "index.js",
"scripts": {
"start": "babel-node server/server.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Ekpang Michael",
import express from 'express';
import cors from 'cors';
import v1Routes from './routes';
const app = express();
const { PORT = 3000 } = process.env;
app.use(cors());
import { google } from 'googleapis';
import dotenv from 'dotenv';
import twilio from 'twilio';
dotenv.config();
const {
SID: accountSid,
KEY: TwilloAuthToken,
APIKEY: googleApiKey,
CX: cx
import { Router } from 'express';
import WhatsappBot from '../controllers/WhatsappBot';
const botRouter = Router();
botRouter.post('/incoming', WhatsappBot.googleSearch);
export default botRouter;
import { Router } from 'express';
import botRouter from './search';
const v1Router = Router();
v1Router.use('/api/v1', botRouter);
export default v1Router;
{
"presets": ["@babel/preset-env"]
}
{
"presets": ["@babel/preset-env"]
}
import { google } from 'googleapis';
import dotenv from 'dotenv';
import twilio from 'twilio';
dotenv.config();
const {
SID: accountSid,
KEY: TwilloAuthToken,
APIKEY: googleApiKey,
CX: cx
} = process.env;
twilio(accountSid, TwilloAuthToken);
const { MessagingResponse } = twilio.twiml;
const customsearch = google.customsearch('v1');