Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

221
Visualizações
I can fetch data in localhost but cannot in production

so I have a Express Typescript codebase:

 public initRoutes() {
    new TemplatesModule(this.app)
    this.app.get("/image", (req, res) => {
      request.get("https://ik.imagekit.io/scenify/kW7LCO9gy_blKfank60BHO3i.png?tr=w-480").pipe(res)
    })
  }
  private initMiddlewares() {
    this.app.use(notFound)
    this.app.use(errorHandler)
  }

So basically I have /templates API route I that connects my MongoDB db to the backend.

So the problem is, In my localhost, I can access my /templates API. However when I try to access the /templates in production at https://consumer-grammable.herokuapp.com/templates, it didn't work. The status code was 304 (its not an error, its "not changing").

If you notice the codebase, I've tried doing https://consumer-grammable.herokuapp.com/image, and it works, but /templates don't work for some reason when it works in development. Any idea why it doesn't work? I suspect it was MongoDB problems, and it maybe it. However, I've changed the network access setting into Allow from anywhere, and it still doesn't work. Can someone help?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda