spring-boot - Google 应用引擎为我的 spring boot rest api 应用程序提供 404

标签 spring-boot google-app-engine google-cloud-platform

我有一个带有 CORSFilter 的纯 API Spring Boot 应用程序。
当我在 google app engine 上部署应用程序时,出现以下屏幕:

Deploy Sreen

但是,URL 给了我这个:

URL Screen

我的完整项目代码is here at GitHUB .

SMSService.java 可能会在编译时出错,因为我必须删除 AWS key 才能将其公开,而他们要求我将其删除。

最佳答案

尝试向您的 app.yaml 添加一个 url hadler:

handlers:
- url: /.*
  script: this field is required, but ignored

还有,你从哪个目录部署?您在这两个文件中都有 app.yaml:

/gcp

gcp/src/main/appengine/

更新:

MainController.java 中,为 / 添加一个 url 处理程序:

public class MainController {

    @RequestMapping("/")
    public String home() {
        return "Hello World!";
    }

关于spring-boot - Google 应用引擎为我的 spring boot rest api 应用程序提供 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52319355/

相关文章:

多个实例上的 Spring 和计划任务

java - 将 Spring boot 1.5 迁移到 2.x 无法启动应用程序

spring - 使用 oauth2 范围而不是角色来保护 spring 执行器管理端点

google-app-engine - Google Cloud SQL 中如何定义 I/O 操作?

hadoop - 在 Google Cloud Dataproc 上运行 xgboost

python - 如何将多个身份验证 ID(例如密码和电子邮件)传递给 "webApp2_extras"用户模型的 user_create 方法?

javascript - 如何在表单提交后添加成功通知

python - 获取 NDB 查询长度 - 在 Google App Engine 上使用 Python

python - Google App Engine 使用 UserProperty 链接数据

google-cloud-platform - GCP - 如何使用 gcloud 过滤启动磁盘?