英文:
How to generate a local client with Encore
问题
我正在使用Encore构建后端,并希望在部署之前在本地与前端一起测试我所构建的内容。
在使用encore gen client
生成客户端时,是否有一种从“本地”实例生成客户端的方法?
英文:
I'm building a backend with Encore and want to test what I am building with my frontend locally, before I deploy.
When generating a client with encore gen client
is there a way to generate the client from the 'local' instance?
答案1
得分: 0
encore gen client
支持指定从哪个环境使用API定义。由于您尚未部署到云环境,您可以指定--env=local
,直接从本地运行的服务生成API定义。
关于如何集成Web前端的更多信息也可以在文档中找到。
英文:
encore gen client
supports specifying which environment to use the API definition from. Since you haven't deployed yet to a cloud environment, you can specify --env=local
to generate it directly from your locally running service.
There's also more information about this in the documentation on how to integrate a web frontend.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论