How to serve static assets #32
-
How do I serve static assets idiomatically in prism? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey, thanks for the question! Prism compiler isn't a full a server framework like nextjs or sapper is and instead is "bring your own backend server library". So to serve static files you will need to wire up a route which points to the static files Prism generates: For a example in JS with express: Or in Rust with actix-web: Hopefully that answers your question! In terms of idiomatic way to do so there isn't one, up to you. Note that Prism is not actively maintained. Feel free to try the unique features but I wouldn't recommend putting it into production at the moment :) |
Beta Was this translation helpful? Give feedback.
Hey, thanks for the question!
Prism compiler isn't a full a server framework like nextjs or sapper is and instead is "bring your own backend server library".
So to serve static files you will need to wire up a route which points to the static files Prism generates:
For a example in JS with express:
https://github.com/kaleidawave/prism-ssr-demo/blob/5eafbea735b3ace0ced8e358e07cd24d11f52655/index.js#L6
Or in Rust with actix-web:
https://github.com/kaleidawave/hackernews-prism/blob/4537652060e0011e2e34be5de64036302d739a03/src/main.rs#L136
Hopefully that answers your question! In terms of idiomatic way to do so there isn't one, up to you.
Note that Prism is not actively maintained. Feel free …