Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

125
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda