API package:servant-static-th

This is a combination of createApiDec and createServerDec. This function is the one most users should use. Given the following code:
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}

$(createApiAndServerDecs "FrontAPI" "frontServer" "dir")
You can think of it as expanding to the following:
$(createApiDec "FrontAPI" "dir")

$(createServerDec "FrontAPI" "frontServer" "dir")
This is similar to createApiType, but it creates the whole type synonym declaration. Given the following code:
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}

$(createApiDec "FrontAPI" "dir")
You can think of it as expanding to the following:
type FrontAPI = $(createApiType "dir")
This is the same as createApiType frontEndTemplateDir.
Take a template directory argument as a FilePath and create a Servant type representing the files in the directory. Empty directories will be ignored. index.html files will also be served at the root. For example, assume the following directory structure:
$ tree dir/
dir/
├── js
│   └── test.js
└── index.html
createApiType is used like the following:
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}

type FrontEndAPI = $(createApiType "dir")
At compile time, it will expand to the following:
type FrontEndAPI =
"js" :> "test.js" :> Get '[JS] ByteString
:<|> Get '[HTML] Html
:<|> "index.html" :> Get '[HTML] Html
This is the String "FrontEnd".