Prevent Your Free Heroku Dyno from Sleeping

Written by fermentationist | Published 2019/10/05
Tech Story Tags: heroku | dyno | nodejs | wake-dyno | host-a-server-on-heroku | heroku-dyno-virtual-machine | hackernoon-top-story | latest-tech-stories

TLDR Free Heroku dyno will take a nap whenever it has gone for thirty minutes or more without web traffic. Nodejs is easy to keep your dyno awake with just a few lines of code. I used Node's setTimeout function to make an HTTP request to my app at regular intervals of less than thirty minutes, thus keeping the dyno from snoozing. This will do the trick of rousing a sleepy dyno, but unlike using setInterval, it will only run once.via the TL;DR App

no story

Written by fermentationist | JavaScript Developer. I love to build things, in code and otherwise. I also brew a righteous Kölsch.
Published by HackerNoon on 2019/10/05