我正在尝试使用 openshift 平台和 sparkjava 创建一个简单的网页,它将我重定向到文件夹“src/main/resources/public”中的静态 html 文件 (index.html)。我已经使用以下命令创建了应用程序,但是当我导航到位置“ http://appname-domainname.rhcloud.com时,页面出现以下错误
Service Temporarily Unavailable 由于维护停机或容量问题,服务器暂时无法为您的请求提供服务。请稍后再试。
用于创建应用程序的命令:
rhc app create appname --from-code=github repository url
用于路由的 Java 代码如下:
public class AppStart {
public static void main(String[] args) {
String IP_ADDRESS = System.getenv("OPENSHIFT_DIY_IP");
int PORT = Integer.parseInt(System.getenv("OPENSHIFT_DIY_PORT"));
setIpAddress(IP_ADDRESS);
setPort(PORT);
staticFileLocation("/public");
get("/",new Route(){
public Object handle(Request request, Response response) {
response.redirect("index.html");
return "";
}
});
}
}
有人可以帮我解决这个问题吗?