@@ -1982,6 +1982,43 @@ public void varOnCatchAll() {
19821982 });
19831983 }
19841984
1985+ @ Test
1986+ public void singlePageApp () {
1987+ new JoobyRunner (app -> {
1988+
1989+ app .assets ("/?*" , new AssetHandler ("fallback.html" , AssetSource .create (app .getClassLoader (), "/www" )));
1990+
1991+ }).ready (client -> {
1992+ client .get ("/docs" , rsp -> {
1993+ assertEquals ("fallback.html" , rsp .body ().string ().trim ());
1994+ });
1995+
1996+ client .get ("/docs/index.html" , rsp -> {
1997+ assertEquals ("fallback.html" , rsp .body ().string ().trim ());
1998+ });
1999+
2000+ client .get ("/docs/v1" , rsp -> {
2001+ assertEquals ("fallback.html" , rsp .body ().string ().trim ());
2002+ });
2003+
2004+ client .get ("/" , rsp -> {
2005+ assertEquals ("index.html" , rsp .body ().string ().trim ());
2006+ });
2007+
2008+ client .get ("/index.html" , rsp -> {
2009+ assertEquals ("index.html" , rsp .body ().string ().trim ());
2010+ });
2011+
2012+ client .get ("/note" , rsp -> {
2013+ assertEquals ("note.html" , rsp .body ().string ().trim ());
2014+ });
2015+
2016+ client .get ("/note/index.html" , rsp -> {
2017+ assertEquals ("note.html" , rsp .body ().string ().trim ());
2018+ });
2019+ });
2020+ }
2021+
19852022 @ Test
19862023 public void staticSiteFromCp () {
19872024 new JoobyRunner (app -> {
0 commit comments