我有一个使用node.js express开发的移动应用程序后端.我尝试将其部署为lambda服务.为此,我创建了一个无服务器框架项目( github/serverless ).以前,我通过启动快速后端应用程序在本地测试了移动应用程序.现在,我找不到没有本地后端就可以在本地测试我的移动应用程序的方法. jaws run命令仅在我调用它后运行.
I have a mobile application backend developed with node.js express. I tried it to deploy it as lambda service. For that I created a Serverless Framework project (github/serverless). Previously I tested mobile app locally by starting express backend application. Now I can't find a method to test my mobile app locally without local backend. jaws run command only run once I called it.
是否有任何方法可以将lambda函数作为Web服务启动?还是没有Serverless Framework的替代品?
Is there any method to start the lambda function as a web service? Or is there any alternative to Serverless Framework?
推荐答案目前看来尚无办法,但1.4.0版即将发布,其中应包括一个新的命令下巴服务"应该可以解决您的问题.
It doesn't look like there's way to do this right now, but version 1.4.0 is about to be released and, among other things, it should include a new command "jaws serve" which should address your problem.
这里是PR: github/jaws-framework/JAWS/pull/269
更新:您现在可以为此使用新的 serverless-serve 插件.
UPDATE: you can now use the new serverless-serve plugin for this.
更新2:无服务器服务已经有一段时间没有更新了,看起来 serverless-offline 是现在可以更好地模拟Lambda函数.
UPDATE 2: serverless-serve hasn't been updated in a while, it looks like serverless-offline is a much better option now to emulate Lambda functions.
更多推荐
如何在本地测试AWS Lambda函数
发布评论