const port = 33843; const express = require('express'); const app = express(); const simple = require('./scraper/simple'); const headless = require('./scraper/headless'); app.use(express.urlencoded({ extended: true })); app.get('/', (req, res) => { const routes = [ '/simple', '/simple/details', '/headless', '/headless/details', '/headless/comments' ]; const html = routes.map(route => `
route: POST ${route}
`).join('
'); res.send(html); }); app.post('/simple/', simple.scrape); app.post('/simple/details', simple.details); app.post('/headless', headless.scrape); app.post('/headless/details', headless.details); app.post('/headless/comments', headless.comments); app.listen(port, () => { console.log(`Example app listening on port ${port}!`); });