Jon Sud
Jon Sud

Reputation: 11641

Can I use serverless framework without cloud providers?

In my company we don't use aws or asuze or any cloud providers yet, so we are deploy our nodejs applications (based on express.js) on physical machine or virtual machine (linux).

However, it is possible to use Serverless Framework just like express.js server?

I saw the serverless offline plugin and it launch a server (endpoint, function) which I can access.

But can I use serverless this way in the production?

Upvotes: 3

Views: 1095

Answers (2)

AAron
AAron

Reputation: 368

Serverless framework is not designed for such a use case, this tool is used for deployments to cloud environment. Offline mode is just a simulation which is supposed to be run in local environment, not production.

Another option would be to use a process manager like PM2. To deploy to the virtual machine you can use tools like ansible and then PM2 will take care of the runtime. It also has some neat features - for example if your server crashes, it can automatically revive it ; cluster mode can run multiple node instances in the virtual machine to utilize all the cores of the CPU which can boost your performance if you run a stateless cluster. It covers more than "serverless offline" is designed for and if you run without containers this would be my next best bet.

Upvotes: 1

Aaron Stuyvenberg
Aaron Stuyvenberg

Reputation: 3777

No, the Serverless Framework is really only useful if you're deploying to a cloud (and mostly it's just AWS). serverless offline will run a small nodejs server, but it's emulating AWS Lambda. So if you'll never use Lambda, there's no real point to emulating it.

In your case, just run a regular nodejs server.

Upvotes: 1

Related Questions