aboutsummaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/app/Main.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/backend/app/Main.hs b/backend/app/Main.hs
index 7ddb475..e7753d7 100644
--- a/backend/app/Main.hs
+++ b/backend/app/Main.hs
@@ -110,6 +110,7 @@ fromAutoTypes path (U.Object ps) =
toProperty (U.Option (Just (U.Scalar "string"))) = "string?" :: String
toProperty (U.Reference i) = "$ref:" <> i
toProperty x = error ("unhandled type: " <> show x)
+fromAutoTypes _ _ = error "Only JSON objects are supported."
watch :: TMVar Repo -> FilePath -> G.RefName -> IO ()
watch repoT root ref = do
@@ -293,4 +294,5 @@ restApi root ref repoT app req respond =
let [collection] = filter ((== c) . (.path)) (last repo.commits).collections
respond . W.responseLBS W.status200 [] $
J.encode (fromAutoTypes c collection.schema)
+ (method, path) -> fail $ "Method " ++ show method ++ " on route " ++ show path ++ " not supported."
_ -> app req respond