What is the best way to link static resources in Nim?

I am currently writing a web application using Jester and would like to facilitate deployment by combining all static resources (CSS, HTML, JS).

What is the best way to do this in Nim?

+4
source share
1 answer

The main way is to use staticRead (aka slurp) to read the file at compile time and have it as a constant in your program. This can become quite tedious, because you will need to do this for each file manually or create a file .nimwith a large number of these calls staticRead()based on the current files in your directory before sending and use these variables.

zip / . Zip , , , (IO , , , , ).

, zip .

+3

Source: https://habr.com/ru/post/1672038/


All Articles