Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

129
Views
How can I deploy an app in which I am using express.js and puppeteer? (smth like an REST API)

Before anything, its my first question on stackoverflow, so im sorry if something isnt
correct.

Here is my repository: https://github.com/Ellisarm/FLASH Details about the app: in index.js file i am using express and i am importing from scrapers.js and meciuri&ids.js 2 functions in which i am scraping 2 arrays. Each functions is used with either app.post or app.get. I assigned a path also to them.

So basically, i want to enter on a http and get some data from there, data which is scraped thanks to puppeteer.

I've tried to deploy the application on heroku, but i didnt recieve the data, i have errors. I've made a lot of research before questioning this...

THIS is my index.js file

const express = require('express')
const cors = require('cors')
const scrapeProduct = require('./scrapers.js')
const scrapeProductSecond = require('./meciuri&ids.js')
const app = express()
const port =  8081

app.use(cors())

app.use(express.json())

app.post('/puppeteer', async (req, res) => {
    const cote = await scrapeProduct(req.body.url)
    
    console.log(cote);
    res.status(201).send(cote)
   
    
})

app.get('/', async(req, res) =>{
    const {echipeAcasa} = await scrapeProductSecond()
    const {echipeDeplasare} = await scrapeProductSecond()
    const {theIds} = await scrapeProductSecond() 
    console.log(typeof echipeAcasa, typeof echipeDeplasare, typeof theIds);
    console.log( echipeAcasa,  echipeDeplasare,  theIds);
    res.status(201).send([echipeAcasa, echipeDeplasare, theIds])
})

app.listen(process.env.PORT || port, ()=> console.log("Example app listening on port " + port))

I would appreciate even a link where i can research more or even a idea... thanks

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!