add collections
This commit is contained in:
21
backend/app/Route.hs
Normal file
21
backend/app/Route.hs
Normal file
@@ -0,0 +1,21 @@
|
||||
module Route (Route (..), parser) where
|
||||
|
||||
import Data.Attoparsec.Char8 qualified as P
|
||||
|
||||
data Route
|
||||
= SchemaJson String
|
||||
| Query
|
||||
| SchemaVersion
|
||||
| Collections
|
||||
deriving (Show)
|
||||
|
||||
parser :: P.Parser Route
|
||||
parser =
|
||||
( P.choice
|
||||
[ pure Collections <* P.string "/collections",
|
||||
pure SchemaVersion <* P.string "/schemaVersion",
|
||||
SchemaJson <$> (P.string "/" *> P.manyTill P.anyChar (P.string ".schema.json")),
|
||||
pure Query <* P.string "/"
|
||||
]
|
||||
)
|
||||
<* P.endOfInput
|
||||
Reference in New Issue
Block a user