Node.js2 minutes to read

Where can I host a small Node.js API or worker for free?

See which Node.js projects fit Bothosting’s free Spark plan, launch an API with no npm dependencies, and check what changes when you need a second process.

What the free plan can run

Bothosting’s Spark plan hosts one small Node.js deployment for free. Choose an HTTP app if someone needs to call a URL, or a worker if your code waits for events. Spark includes 256 MB of memory, 25% CPU and 512 MB of storage. No card is required. Renew in the dashboard every 7 days.

A useful first project is an API that returns the opening hours for a club. One server can answer several routes, so adding a route for holiday hours still uses one deployment. A separate reminder worker needs another slot. Compare Node.js runtime options.

Get a response you can recognize

Choose HTTP app or API and upload the Node.js API starter. Set MAIN_FILE to index.mjs and start the deployment. On a host with HTTP routing enabled, open the HTTPS address in Settings. A visit to the root path returns this JSON.

Expected response from the starter
{"service":"node-api","status":"ok"}

Change the service name in the file, restart and request the address again. Seeing your own name in the response confirms which code is serving that URL. For a worker, watch the worker starter print two successive timestamps in Console.

Will my own project fit?

Repeat the test with the dependencies and payloads you actually use. An API that fits while idle can run out of memory processing a large upload. A package install also needs disk space before the app handles its first request. Check both a fresh install and the busiest request you expect to serve. If you need an independent API and worker, count both deployments and their combined resources. Check the free plan and paid limits.