How to generate a local client with Encore

huangapple go评论100阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2021年9月3日 16:22:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/69041711.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定