DEV Community

loading...

Discussion on: Tutorial: Refactor Your Node.js and Express APIs to Serverless APIs with Azure Functions

Collapse
alexandrusimandi profile image
Alexandru Simandi

Hello, I did this on a previous project.
The problem that I found with moving express routes to a serverless environment is that the express lib is reloaded on each call. Due to the nature of js and express, when a route is called for the first time, it takes a lot longer to respond. Each call is considered a fresh boot up on the express server and this raises costs.

Collapse
john_papa profile image
John Papa Author

Hi. There is no express in serverless. But I know what you mean - I think you’re referring to the cold start that serverless can encounter. There are ways to help with this - including timers or the azure functions premium model.

Collapse
alexandrusimandi profile image
Alexandru Simandi

Correct. I was speaking from the perspective of moving to serverless with a limited budget on the team.