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

161
Vistas
Change global variables programmatically using Heroku?

I currently have an application built with Express.js that runs via Heroku. I need to define a global variable that I can decrement each time a specific function is called, but I'm not sure how to do that programatically. I have a file of constants called consts.js and was trying to just set the variable (REMAINING) as follows: CONST.REMAINING -= 1 whenever the function is called, but unfortunately that doesn't work. What is a better way to go about this?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

There's a good explanation of Heroku’s ephemeral filesystem which is a good place to start. In a nutshell, do not use the /tmp to store any variables or application level data as it will get destroyed.

It is suggested to use Amazon S3 or a similar durable store. It may be overkill for a single variable but I would look at using Redis just because of its speed. You could also look at programmatic access of Heroku config vars as well.

about 4 years ago · Santiago Trujillo Denunciar
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