无法从 http://localhost:9000/api-docs/ 读取 swagger JSON

Vin*_*tia 5 swagger-ui jhipster

api-docs 之前运行良好。它停止工作了,现在我明白了

Can't read swagger JSON from http://localhost:9000/api-docs/
Run Code Online (Sandbox Code Playgroud)

如果我更改 src/main/webapp/swagger-ui/index.html

var apiUrl = "http://localhost:8080/swagger-ui/index.html";
Run Code Online (Sandbox Code Playgroud)

我收到“无法从服务器读取。它可能没有适当的访问控制源设置。”

Vin*_*tia 0

请参阅 Jerome 在https://github.com/jhipster/generator-jhipster/issues/277上的修复,方法是更改​​ gruntfile.js 以在 connect/proxies 部分中包含以下行

,{
context: '/api-docs',
host: 'localhost',
port: 8080,
https: false,
changeOrigin: false
}
Run Code Online (Sandbox Code Playgroud)