The static files are automatically served from the resources/public
folder (on the classpath):
my_project/resources/public
src/main/resources/public
--resource-dir resources
Let's serve an example.js
file with Sharaf.
First create a file resources/public/example.js
.
Put this text into it: console.log('Hello Sharaf!');
.
Now create a file static_files.sc
and paste this code into it:
and run it like this:
Go to http://localhost:8181/example.js.
You will see the example.js
contents served.