This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express'; | |
import cors from 'cors'; | |
import v1Routes from './routes'; | |
const app = express(); | |
const { PORT = 3000 } = process.env; | |
app.use(cors()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { google } from 'googleapis'; | |
import dotenv from 'dotenv'; | |
import twilio from 'twilio'; | |
dotenv.config(); | |
const { | |
SID: accountSid, | |
KEY: TwilloAuthToken, | |
APIKEY: googleApiKey, | |
CX: cx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Router } from 'express'; | |
import WhatsappBot from '../controllers/WhatsappBot'; | |
const botRouter = Router(); | |
botRouter.post('/incoming', WhatsappBot.googleSearch); | |
export default botRouter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Router } from 'express'; | |
import botRouter from './search'; | |
const v1Router = Router(); | |
v1Router.use('/api/v1', botRouter); | |
export default v1Router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": ["@babel/preset-env"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"presets": ["@babel/preset-env"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { google } from 'googleapis'; | |
import dotenv from 'dotenv'; | |
import twilio from 'twilio'; | |
dotenv.config(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
SID: accountSid, | |
KEY: TwilloAuthToken, | |
APIKEY: googleApiKey, | |
CX: cx | |
} = process.env; | |
twilio(accountSid, TwilloAuthToken); | |
const { MessagingResponse } = twilio.twiml; | |
const customsearch = google.customsearch('v1'); |
OlderNewer