2

I wanted to externalise the email templates to send email notifications so I am storing them in a templates folder in GIT repository which is mapped to our spring-cloud-config server.

The templates folder in git repository has some .html files. Can someone help me with the cloud config URL to access .html files.

4

1 回答 1

0

生成应用

例如,采用 baseName 为mscreated with的默认微服务应用程序jh import-jdl --inline "application { config { applicationType microservice, baseName ms } }"

添加 HTML 文件

添加文件src/main/docker/central-server-config/localhost-config/example.html

<html><body><h1>${configserver.name}</h1></body></html>

启动 JHipster 注册表

启动 JHipster Registry docker-compose -f src/main/docker/jhipster-registry.yml up -d,它将提供我们创建的配置和 HTML 文件。

请求 HTML 文件

要通过 JHipster Registry 访问此文件,您可以使用以下 URL。模板中的任何变量都将替换为 JHipster Registry 配置文件中存在的配置变量。格式为http://user:password@registry-url:8761/config/app-name/profile/git-label/example.html::

curl http://admin:admin@localhost:8761/config/ms/prod/master/example.html

哪个会返回:

<html><body><h1>Docker JHipster Registry</h1></body></html>
于 2020-10-22T18:20:47.637 回答