Skip to content

Vercel is only serverless

I needed to host a small application on Express - a wrapper over the Telegram Bot API, which turns posts from the channel into an RSS feed to broadcast them to other platforms.

The application is quite simple, there should be no load on it - it is planned to access it once a day from a cron job. Well, I want to place it somewhere for free, so that I place it and forget about it.

At first I thought of putting it on render.com - there are full-fledged free Node instances, albeit with limited resources. Then I thought, let me check, maybe Vercel has something.

I immediately find this article https://vercel.com/guides/using-express-with-vercel - where it is written very beautifully:

Deploying an Express.js application on Vercel should require minimal or no code changes.

I’m already thinking, well done, they made a free tariff for classic Node applications like Render. Cool!

No such luck. In fact, in the example they simply put the Express instance into a Serverless function in the /api folder. Although the article says this, when you think about deploying an Express application, you imagine deploying a traditional Node server. For a long time I really couldn’t figure out why my server wouldn’t start.

Then it became clear that they simply export an Express instance as a function handler. An Express instance is callable, and accepts Response and Request, which are actually passed to the Vercel handler by the function.

Then it became unclear why Express was needed at all - all the logic could be done in Serverless functions 😁. But in my case, let it give a certain freedom of deployment. If I want to deploy as a classic application, I will have the opportunity.

In summary: I just wanted to deploy a Node application, but I had to delve into how Vercel’s Serverless functions work. It couldn’t be done without modifying the code, since the subtleties are the same as in AWS lambdas. In general, it is more convenient to work with Vercel functions, due to the simpler deployment.