add index to FileServer
This commit is contained in:
parent
c1b8e59da6
commit
65289927b0
1 changed files with 7 additions and 1 deletions
|
@ -63,8 +63,14 @@ public class FileServer implements IRequestCatcher, RequestHandler.Listener {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/.*")
|
@Path(".*/")
|
||||||
public void onIndex(Request request, Callback<Response> res, Callback<Throwable> rej) {
|
public void onIndex(Request request, Callback<Response> res, Callback<Throwable> rej) {
|
||||||
|
res.call(new Response(request, request.context.file(data.getString("dir") + request.path.replace("..", "") + "/index.html"), 200, "OK"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/.+")
|
||||||
|
public void onFile(Request request, Callback<Response> res, Callback<Throwable> rej) {
|
||||||
res.call(new Response(request, request.context.file(data.getString("dir") + request.path.replace("..", "")), 200, "OK"));
|
res.call(new Response(request, request.context.file(data.getString("dir") + request.path.replace("..", "")), 200, "OK"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue