Issue making http call from application to external API
I have a Nuxt 3 app with a server route that is responsible for calling an external API:
https://hacker-news.firebaseio.com/v0/item/${itemID}.json
which works great locally and on render.com, but fails when deployed on dokploy (on hetzner cloud).
It seems to be an issue with establishing a TLS connection:
Is there something that needs to be setup when I want to make calls to an external API from a service?18 Replies
Looks like is related to firebase, I never used firebase before, but probably you can add some whitelist ip or edit some firewall rules?
Do you mean on the dokploy side or the firebase side? The clarify, the firebase URL i'm calling is an open firebase API for Hacker News and not something I have control over. See this as an example: https://hacker-news.firebaseio.com/v0/item/41372129.json
are you using dockerfiles or nixpacks?
nixpacks! I'm deploying this repo: https://github.com/StefanVDWeide/modern-orange and this is the server route that fails: https://github.com/StefanVDWeide/modern-orange/blob/master/server/api/getIndividualStoryRest.post.ts
GitHub
GitHub - StefanVDWeide/modern-orange: a modern Hacker News client b...
a modern Hacker News client built with Nuxt 3 and based on the official HN API - StefanVDWeide/modern-orange
GitHub
modern-orange/server/api/getIndividualStoryRest.post.ts at master ·...
a modern Hacker News client built with Nuxt 3 and based on the official HN API - StefanVDWeide/modern-orange
got it, let me try
Modern Orange
A modern Hacker News client

I just pushed a fix! I added a fetch call to google just to make sure it works at all and that one succeeded
did you added this env ?
NIXPACKS_START_CMD="npm run preview"
Turns out that making too many api calls is messing with TLS somewhere, either at the firebase side or dokploy, not sure
No I have this as start command: NIXPACKS_START_CMD="node .output/server/index.mjs"
As per the Nuxt docs
hmmm probably that could be the issue
But preview is not meant for production, no?
or let me try, you are right that's the correct production start command
At least not for nuxt
yeah you are right, im not familiar with nuxt
But the issue seems solved now
I can make an example for Dokploy if you want!
I work a lot with nuxt
Would be awesome if you can do it
we have this repo for examples https://github.com/Dokploy/examples
GitHub
GitHub - Dokploy/examples: Examples to deploy on Dokploy
Examples to deploy on Dokploy. Contribute to Dokploy/examples development by creating an account on GitHub.