easoncxz / twitanalysis

Dig your Twitter data
https://easoncxz.github.io/twitanalysis
Other
1 stars 0 forks source link

Serve front-end app using static directory #1

Closed easoncxz closed 4 years ago

easoncxz commented 4 years ago

Docs about serving static files using Scotty:

module Main where

import           Network.Wai.Middleware.Static        (addBase, noDots, staticPolicy, (>->))
import           System.Environment                   (lookupEnv)
import           Web.Scotty                           (middleware, scotty, get, html)

main :: IO ()
main = do
  let port =3000
  scotty port $ do
    middleware $ staticPolicy (noDots >-> addBase "static/images")
    get "/" (html "Hello!")

Not sure how relevant Blaze is; it looks like a server-side templating library, which may turn out useful when it comes to rendering the page in which some single-page JavaScript app is served, perhaps via a static URL.

easoncxz commented 4 years ago

As such, this ticket can be closed. HTML and JavaScript now served via:

With the exception of the favicon!! -- which is at: