added router to svelte
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -13,9 +13,12 @@ import java.io.IOException;
|
||||
public class WebHandler extends PathHandler {
|
||||
@Override
|
||||
public boolean doGet(Path path, HttpExchange ex) throws IOException {
|
||||
|
||||
LOG.log(DEBUG,"doGet({0},ex)",path);
|
||||
if (path.empty()) {
|
||||
// we always need to load the index.html first, when we encounter something like /module/entry/4/view
|
||||
// the index page itself references required elements with absolute path: /assets/index-x.js
|
||||
var first = path.isEmpty() ? null : path.firstElement();
|
||||
if (first == null || !first.contains(".")){
|
||||
path.clear();
|
||||
path.push("index.html");
|
||||
}
|
||||
var url = getClass().getClassLoader().getResource("web/"+path);
|
||||
|
||||
Reference in New Issue
Block a user