-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
36 lines (31 loc) · 1.22 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// puppeteer-extra is a drop-in replacement for puppeteer,
// it augments the installed puppeteer with plugin functionality.
// Any number of plugins can be added through `puppeteer.use()`
const puppeteer = require('puppeteer-extra')
// Add stealth plugin and use defaults (all tricks to hide puppeteer usage)
const StealthPlugin = require('puppeteer-extra-plugin-stealth')
puppeteer.use(StealthPlugin())
// Add adblocker plugin to block all ads and trackers (saves bandwidth)
const AdblockerPlugin = require('puppeteer-extra-plugin-adblocker')
puppeteer.use(AdblockerPlugin({ blockTrackers: true }))
const goodrx = require('./built/goodrx')
const lowermyrx = require('./built/lowermyrx')
const optumperks = require('./built/optumperks')
const rxsaver = require('./built/rxsaver')
const wellrx = require('./built/wellrx')
exports.entrypoint = (req, res) => {
switch (req.path) {
case '/goodrx':
return goodrx.invoke(req, res)
case '/lowermyrx':
return lowermyrx.invoke(req, res)
case '/optumperks':
return optumperks.invoke(req, res)
case '/rxsaver':
return rxsaver.invoke(req, res)
case '/wellrx':
return wellrx.invoke(req, res)
default:
res.send('function not defined')
}
}