我有一个简单的服务器
{-# LANGUAGE OverloadedStrings #-}
import Web.Scotty
import Data.Text
import Data.Monoid (mconcat)
server :: ScottyM ()
server = do
get "/" $ file "./index.html"
我想在所有路线上提供index.html
例如。 get "*" $ file "./index.html"
,但这不起作用。如何实现?
答案 0 :(得分:0)
与提供的示例相同: https://github.com/scotty-web/scotty
{-# LANGUAGE OverloadedStrings #-}
import Web.Scotty
import Data.Monoid (mconcat)
main = scotty 3000 $
get "/:word" $ do
file "./index.html"