Using fastify to build some nodejs backend API, here is part of my code snippet:
fastify.get('/', async (request, reply) => {
return { data: 'ok...' }
})
Deploy it on my Tencent Clound Server
Install some related dependencies, and using pm2 to keep my application online. Using curl to test my API currectly:
curl http://localhost:5500/
{"data":"ok..."}
But when I tried to request my test api using public ip address: http://1.xx.xx.xx:5500/, but it reminded me: connect refused.
And I tried to use curl to test my API by 127.0.0.1, get the same error:
curl http://127.0.0.1:5500/
// connect refused
P.S:
I have disabled firewall:
And the 5050 port is open on my cloud server: