A website consists of two types of contents, static contents and dynamic contents. The static contents are the HTML files, images, a folders containing these files. These contents do not change per request. The dynamic contents depend upon route, parameters, and request type. The Snap Framework allows us to serve static contents seamlessly with the dynamic contents. In this recipe, we will look at how we can serve static contents with the Snap Framework.
Serving static contents in Snap
How to do it...
- Create a new project, static-contents-in-snap, with the simple stack template:
stack --resolver lts-9.1 new static-contents-in-snap simple
- Add a dependency on the following libraries in the build-depends subsection...