3
我目前正在使用dropwizard和angularjs構建一個應用程序。我安裝我的AssetsBundle像這樣:Dropwizard服務靜態HTML
bootstrap.addBundle(new AssetsBundle("/assets", "/", "index.html"));
我現在的問題是,我想多頁爲我的index.html頁面(主要angularjs應用頁面)。無論如何,我可以定義一組url來爲所有這個index.html文件提供服務嗎?如果我創造更多的資產包然而,這會工作,這是不應該怎麼做:目前
bootstrap.addBundle(new AssetsBundle("/assets", "/login", "index.html", "login"));
bootstrap.addBundle(new AssetsBundle("/assets", "/my-leagues", "index.html", "my-leagues"));
bootstrap.addBundle(new AssetsBundle("/assets", "/registering-leagues", "index.html", "registering-leagues"));
bootstrap.addBundle(new AssetsBundle("/assets", "/league-register/*", "index.html", "league-register"));
bootstrap.addBundle(new AssetsBundle("/assets", "/", "index.html", "home"));
我的目標是讓index.html頁面送達/登錄,/我的聯賽,/註冊/聯賽註冊/ *(其中*可以是任何數字)和/。這個hacky解決方案不適用於「/ league-register/*」資產,因爲資產包不支持通配符。
有沒有一種簡單的方法來指定某些終點來返回我的index.html文件?
謝謝!