【发布时间】:2021-02-24 09:47:00
【问题描述】:
首先,我是 Jhipster 的新手。我已经创建了 jhipster 网关(前端),没有应用程序(后端)。
我原以为这不会起作用,因为后端不存在/不工作,所有服务调用都将通过后端访问数据库。
当我尝试使用 http://localhost:8080 访问前端时,我可以看到一切正常。我不确定如何。谁能解释一下?
JHipster v6.10.5 用于此。
谢谢 希里什
JHispter 命令行的应用程序响应:
? Which *type* of application would you like to create? Microservice gateway
? [Beta] Do you want to make it reactive with Spring WebFlux? No
? What is the base name of your application? gateway
? As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8080
? What is your default Java package name? com.btn.test
? Which service discovery server do you want to use? JHipster Registry (uses Eureka, provides Spring Cloud Config support and monitoring dashboards)
? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token)
? Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL)
? Which *production* database would you like to use? MySQL ? Which *development* database would you like to use? MySQL
? Do you want to use the Spring cache abstraction? Yes, with the Hazelcast implementation (distributed cache, for multiple nodes, supports rate-limiting for gateway applications)
? Do you want to use Hibernate 2nd level cache? Yes
? Would you like to use Maven or Gradle for building the backend? Maven
? Which other technologies would you like to use?
? Which *Framework* would you like to use for the client? Angular
? Would you like to use a Bootswatch theme (https://bootswatch.com/)? Default JHipster
? Would you like to enable internationalization support? No
? Besides JUnit and Jest, which testing frameworks would you like to use? Gatling, Cucumber, Protractor
? Would you like to install other generators from the JHipster Marketplace? (y/N) No
emp.jdl
/**
* The Employee entity.
* @author Shirish Bathe
*/
entity Employee {
name String required unique
dept String
}
现在我使用 http://localhost:8080 访问网关并尝试访问员工实体。我能够在表格中看到(假)数据。
因此,即使后端应用程序不存在,应用程序也可以正常工作。如何?我错过了什么吗?
【问题讨论】:
标签: jhipster