Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 Heroku 上使用维护模式。
但是对于一个API来说,维护模式似乎不起作用。我的 API 调用已停止,因为不存在标头“Access-Control-Allow-Origin”。因此,无法知道 API 是否处于维护模式,或者它是否只是没有响应。
当应用程序是 API 时,有没有办法使用 Heroku 维护模式?
目前,不幸的是没有。当您设置自定义维护页面时,它会作为 iframe 嵌入到 Heroku 提供的 HTML 页面中。正如您所确定的,未设置 CORS 标头,因此您的 API 客户端甚至不会获取该页面。
请参阅有没有办法在没有 iframe 的情况下直接提供 Heroku 错误/维护 url