Answer the question
In order to leave comments, you need to log in
Heroku shuts down by itself, how to fix?
I decided to write a telegram bot using the weather api. Everything works locally. I wanted to upload to heroku, but the bot only works when the heroku tab itself is open.
The commands I did to push to heroku are:
1. brew tap heroku/brew && brew install heroku
2. heroku login
3. heroku create
4. git init
5. git add .
6. git commit -m '....'
7. heroku git:clone -a ......
8. git push heroku master
(could have made syntax errors in commands but it worked)
After that, the bot worked (as in the case when I uploaded it to Heroku via github.), but after a while it hung and did not respond to commands. If I write some command, then the answer to it comes in an hour ( + - ). Strange, I did it on video.
Contents of package.json :
{
"name": "weatherBot",
"version": "1.0.0",
"description": "",
"main": "weather.js",
"dependencies": {
"node-fetch ": "^2.6.6",
"node-telegram-bot-api": "^0.54.0"
},
"devDependencies": {},
"scripts": {
"start": "
"keywords": [],
"author": "",
"license": "ISC"
}
Content of Procfile :
worker: node weather.js
If anything - I didn't add anything related to servers and host to weather.js file
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question