Is it possible to add routes dynamically at compile time through a config file by using Template Haskell or any other way.
Scotty has a function addRoute but I want to use it dynamically.
Example
import qualified Data.Text.Lazy as LTB
sampleRoutes :: [(String, LTB.Text)]
sampleRoutes = [("hello", LTB.pack "hello"), ("world", LTB.pack "world")]
I want to iterate over the sampleRoutes array and define routes and responses at compile time.
import Web.Scotty
main = scotty 3000 $ do
middleware logStdoutDev
someFunc sampleRoutes