Extension and static folder #284
-
I'm trying to create an extension. I have many doubts, but for now I consult the following: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @josejachuf, it's not possible to have a separated static source, thus you have 2 options:
The 2nd option would be something like this: from emmett import response
from emmett.http import HTTPFile
def stream_route():
full_path = "something/in/your/module.js"
raise HTTPFile(
full_path,
headers=response.headers,
cookies=response.cookies
) then in your def on_load(self):
self.app.route("/someurl")(stream_route) you can probably get the paths dynamically with something like |
Beta Was this translation helpful? Give feedback.
Hi @josejachuf, it's not possible to have a separated static source, thus you have 2 options:
static
folder in your extensionon_load
methodThe 2nd option would be something like this:
then in your
on_load
bind the route:you can probably get the paths dynamic…