Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

How to serve static assets #32

Answered by kaleidawave
ca-d asked this question in Q&A
Discussion options

You must be logged in to vote

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 …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kaleidawave
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants