summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Run/Que.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/Run/Que.hs b/Run/Que.hs
index 8171fbe..aee021d 100644
--- a/Run/Que.hs
+++ b/Run/Que.hs
@@ -28,7 +28,7 @@ import Data.Text.Lazy ( Text
, fromStrict
)
import qualified Data.Text.Lazy as Text
-import GHC.Base ( String )
+import qualified Network.HTTP.Types.Status as Http
import qualified Network.Wai as Wai
import qualified Network.Wai.Handler.Warp as Warp
import Network.Wai.Middleware.RequestLogger
@@ -70,6 +70,13 @@ routes :: Scotty.ScottyT Text App ()
routes = do
Scotty.middleware logStdoutDev
+ let quepath = "^/([[:alnum:]_]*)/([[:alnum:]_/]*)$"
+
+ Scotty.matchAny (Scotty.regex "^/([[:alnum:]_]*)/?$") <| do
+ -- matches '/ns' and '/ns/' but not '/ns/path'
+ Scotty.status Http.notImplemented501
+ Scotty.text "namespace management coming soon"
+
-- | Receive a value from a que. Blocks until a value is received,
-- then returns. If 'poll=true', then stream data from the Que to the
-- client.
@@ -129,9 +136,6 @@ insertQue ns qp q as = as { ques = newQues }
newQues = HashMap.insert ns newQbase (ques as)
newQbase = HashMap.insert qp q <| grab ns <| ques as
-quepath :: GHC.Base.String
-quepath = "^/([[:alnum:]_]*)/([[:alnum:]_/]*)$"
-
extract :: Scotty.ActionT Text App (Namespace, Quepath)
extract = do
ns <- Scotty.param "0"