Servant.Static.TH
servant-static-th
allows you to embed a directory of static files in your
application and serve them from your Servant server
For documentation and usage examples, see the documentation on Hackage.
Embed a directory of static files in your application and serve them from your Servant server
Home Page: http://hackage.haskell.org/package/servant-static-th
License: BSD 3-Clause "New" or "Revised" License
servant-static-th
allows you to embed a directory of static files in your
application and serve them from your Servant server
For documentation and usage examples, see the documentation on Hackage.
Has anybody experience using this package with cabal?
My problem is that the FilePath
s can only be resolved if I give the absolute Path, but I would like the package to be self-contained.
Specifying data-dir
in the .cabal
file and accessing the file via getDataDir
does not work since the files are needed at compile-time, not at runtime.
It takes long compile time when one of the front-end files becomes to be around 100K bytes.
A 100K bytes js files are likely such as one it imports babel-polyfill
.
After installing dependent libraries,
stack build --flag servant-static-th:buildexample
takes
It must be a sort of bottleneck to let people to use this fantastic servant-static-th
in real world applications.
Hi,
I wonder if it's possible to modify the public API of this library in a way that would allow embedding of compressed assets? The idea is to apply the most aggressive gzip compression on JS/CSS assets as part of a build pipeline, so that they are served directly as gzipped resources without having to spend CPU cycles on on-the-fly encoding.
It's a hidden file created by Mac OS in many directories. I can be safely ignored for the purpose of this library.
Is there a way to configure servant-static-th
to map particular file to /
path? Based on the documentation there doesn't seem to be a way to do this currently. Is there a way around this limitation?
Is there a recommended way of generating type-safe links for a directory who's API has been created by createApiAndServerDecs
?
These are source-map files for minified / uglified CSS/JS files. There should probably be a config option in the user-facing API which controls whether these files should be served, or not.
Hello,
I have static files (.sass) that do not need to be served but ignored by the extensionToMimeTypeInfoEx function
Right now, it fails with "unknown extension type"
Do you have a plan for such issue already ?
Thanks for your reply.
Alexandre
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.