I’ve recently managed to create a working telegram bot and is really happy about it.
To further improve the bot, I’m trying to expose part of the JSON collected via telegram to publish a map but soon realise that using express and listening to “process.env.ENV” (same as the telegram bot) results in ‘Error: listen EADDRINUSE 0.0.0.0:3000’ due to the multiple listens and disabling one of the listens(telegrambot/express) would enable to other to work.
hence i would like to query if it is possible to have 2 ports listening at the same time so the telelgram bot can work and at the same time expose data for the website to work.
I do realise that a work around is to use the app to write part of the data onto a json host such as ‘http://myjson.com/’ and have a glitch website retrieve the json data from the json host. if listening on multiple ports is not feasible I’ll use the work around