Use Custom Static Files (JS, CSS) in a Webapp¶
If the library you are looking for is not available in DSS, a quick way to load it, if your library is already hosted, is to simply link from your HTML:
Import libraries using the graphical interface¶
If you have admin rights on your DSS instance, you can click on the cog icon the top-right corner and select “Edit local/static contents”.
In the libraries editor, you can either create and edit files within DSS, or upload your files.
Import libraries using the command line¶
If you have many files to imports, you may want to use the command line, here is how:
Go to the DSS Data Directory
- Check for the presence of a local/static directory. Create it if needed: inside a terminal, enter
mkdir -p local/static
Using static files in your webapp¶
Once they are in you can now use the static files from the HTML code of your webapp as in the following example (Not that there is a ‘/’ before “local”)
A word of explanation: this works thanks to DATA_DIR/nginx/conf/nginx.conf, which maps /local/static/ to dss-data-dir/local/static/.