diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2017-05-20 21:47:51 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2017-05-20 21:47:54 +0300 |
commit | 76c744963a3e7cbfc2f7d3aa8a3321c3eb200aa2 (patch) | |
tree | be78c5b7be4bc3958ac43c6e37ee7de99accb59b | |
parent | 40f6fd333b551eae338daf1fa4d4526725766636 (diff) | |
download | mywatch-76c744963a3e7cbfc2f7d3aa8a3321c3eb200aa2.tar.gz |
Rename index.html -> app.html
Not to confuse Hackage.
-rw-r--r-- | app.html (renamed from index.html) | 0 | ||||
-rw-r--r-- | mywatch.cabal | 3 | ||||
-rw-r--r-- | src/Application.hs | 3 |
3 files changed, 4 insertions, 2 deletions
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 |