Fastify does not work on custom apps.
-
I tried to deploy a custom app that a made in fastify (nodejs) build with ESBuild to keep everything in a single file. But an application build with fastify does not complete the health check.
const fastify = require('fastify')(); fastify.get('/', async (request, reply) => { return 'Hello, World!'; }); const start = async () => { try { await fastify.listen(3000); console.log('Server is running on port 3000'); } catch (err) { console.error(err); process.exit(1); } }; start();
Does any one already deploy a backend api app made with Fastify to cloudron?
-
I am no fastify expert, but the Cloudron healthcheck (defaulting to /) expects a 2hundred something (so like 200, 201, ...) http status code to let is succeed.
Do you see your route handler being hit every 10seconds for a start and does that route handler reply with a 200 if you just return a string from the function?
-
In the CloudronManifest.json be sure to have
httpPort
to 3000.Also, does
await fastify.listen(3000);
listen on 0.0.0.0 or just localhost ? It should listen on 0.0.0.0 / :: to be able to reachable from outside the container. -
You can check if
listen({ host: '0.0.0.0', port: 3000 })
makes it better. -