【发布时间】:2020-11-30 15:52:25
【问题描述】:
在将 spring-boot 部署到弹性 beanstalk 上时,我无法将它连接到 rds 数据库实例。我遵循了指南https://www.devglan.com/spring-boot/spring-boot-angular-deployment,它帮助我将我的应用程序转换为 jar 文件,然后将其部署到弹性 beanstalk 上。问题是,当我从命令行(本地)运行 jar 文件时,该项目工作得非常好,但是一旦我将 jar 文件上传到弹性 beanstalk 并转到 URL,它似乎没有连接到 rds . 但是,我确实知道,这可能是因为我的 Angular 应用程序中的基本 URL 和搜索 URL,因为在我的打字稿文件中,我的 URL 是
private baseUrl = "http://localhost:8080/api/products";
private search = "http://localhost:8080/api/product-category";
在网络控制台中,我收到了
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8080/api/product-category. (Reason: CORS request did not succeed).
但我不确定将 URL 的“localhost:8080”部分更改为什么。如果我应该提供其他任何东西,请随时告诉我。我还想补充一点,我确实在提供的 URL 上看到了我的 Angular 应用程序,但该网站似乎没有从数据库中检索。 谢谢
【问题讨论】:
标签: angular amazon-web-services spring-boot amazon-rds