ich versuche gerade mit Tornado einen StaticFileHandler zu erstellen
dazu habe ich einen Code a la
Code: Alles auswählen
("/foo/bar/test.js", StaticFileHandler, {"path": "/path/to/testjs"})
Was mache ich falsch?
Schöne Grüße
Markus
Code: Alles auswählen
("/foo/bar/test.js", StaticFileHandler, {"path": "/path/to/testjs"})
Also:Note that a capture group in the regex is required to parse the value for the path argument to the get() method (different than the constructor argument above); see URLSpec for details.
Code: Alles auswählen
("/foo/bar/(test\.js)", StaticFileHandler, {"path": "/path/to/testjs"})
Hi Sirius,Sirius3 hat geschrieben: ↑Mittwoch 15. Januar 2020, 13:24 StaticFileHandle ist dazu gedacht, ganze Verzeichnisbäume unterhalb von `path` bereitzustellen.
Aus der Dokumentation:Also:Note that a capture group in the regex is required to parse the value for the path argument to the get() method (different than the constructor argument above); see URLSpec for details.würde nur eine Datei `/path/to/testjs/test.js` unter der URL http://xxx/foo/bar/test.js bereitstellen.Code: Alles auswählen
("/foo/bar/(test\.js)", StaticFileHandler, {"path": "/path/to/testjs"})
Code: Alles auswählen
("/foo/bar/(.*)", StaticFileHandler, {"path": "/anotherpath/to/somewhere"})
("/foo/bar/js/(test\.js)", StaticFileHandler, {"path": "/path/to/testjs"})
Im Nachhinein gesehen, kann ich dem nur zustimmen.__blackjack__ hat geschrieben: ↑Mittwoch 15. Januar 2020, 14:09 @tschaka81: Das in eine sinnvolle Reihenfolge bringen‽ Ich meine es ist doch klar das das so herum nicht funktionieren konnte. "/foo/bar/(.*)" trifft halt auch auf "/foo/bar/test.js" zu.