aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app.html (renamed from index.html)0
-rw-r--r--mywatch.cabal3
-rw-r--r--src/Application.hs3
3 files changed, 4 insertions, 2 deletions
diff --git a/index.html b/app.html
index 6a75cf4..6a75cf4 100644
--- a/index.html
+++ b/app.html
diff --git a/mywatch.cabal b/mywatch.cabal
index ee3813b..3c4118e 100644
--- a/mywatch.cabal
+++ b/mywatch.cabal
@@ -14,7 +14,7 @@ build-type: Simple
extra-source-files: README.md ChangeLog.md
cabal-version: >= 1.20
data-files:
- index.html
+ app.html
static/external/bootstrap/css/*.min.css
static/external/bootstrap/js/*.min.js
static/external/jquery-2.2.4.min.js
@@ -45,6 +45,7 @@ executable mywatch
, data-default-class
, docopt >= 0.7
, fast-logger
+ , filepath
, http-types >= 0.9
, interpolatedstring-perl6 >= 1.0
, MissingH
diff --git a/src/Application.hs b/src/Application.hs
index bdedd5e..3c57079 100644
--- a/src/Application.hs
+++ b/src/Application.hs
@@ -24,6 +24,7 @@ import Network.Wai.Middleware.RequestLogger (Destination(Handle),
mkRequestLogger, RequestLoggerSettings(destination, outputFormat),
OutputFormat(CustomOutputFormat))
import Network.Wai.Middleware.Static (addBase, hasPrefix, staticPolicy, (>->))
+import System.FilePath.Posix ((</>))
import System.IO (stderr)
import Web.Scotty (ScottyM, ActionM, middleware, json, file, addroute, get,
delete, status, text, param, scottyApp)
@@ -47,7 +48,7 @@ myProcess ps logger dataDir = do
middleware $ Gzip.gzip Gzip.def {Gzip.gzipFiles = Gzip.GzipCompress}
middleware $ staticPolicy (hasPrefix "static" >-> addBase dataDir)
- get "/" $ file (dataDir ++ "/" ++ "index.html")
+ get "/" $ file (dataDir </> "app.html")
get "/serverlist.json" $ json (sort $ HM.keys ps)
get "/server/:server/processlist.json" $ apiGetProcessList ps