mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
fastcgi: rename /info to /grammar
This commit is contained in:
@@ -36,7 +36,7 @@ cgiMain pgf =
|
|||||||
"/complete" -> return (doComplete pgf) `ap` getText `ap` getCat `ap` getFrom `ap` getLimit
|
"/complete" -> return (doComplete pgf) `ap` getText `ap` getCat `ap` getFrom `ap` getLimit
|
||||||
"/linearize" -> return (doLinearize pgf) `ap` getTree `ap` getTo
|
"/linearize" -> return (doLinearize pgf) `ap` getTree `ap` getTo
|
||||||
"/translate" -> return (doTranslate pgf) `ap` getText `ap` getCat `ap` getFrom `ap` getTo
|
"/translate" -> return (doTranslate pgf) `ap` getText `ap` getCat `ap` getFrom `ap` getTo
|
||||||
"/info" -> return (doInfo pgf) `ap` requestAcceptLanguage
|
"/grammar" -> return (doGrammar pgf) `ap` requestAcceptLanguage
|
||||||
_ -> throwCGIError 404 "Not Found" ["Resource not found: " ++ path]
|
_ -> throwCGIError 404 "Not Found" ["Resource not found: " ++ path]
|
||||||
outputJSON json
|
outputJSON json
|
||||||
where
|
where
|
||||||
@@ -100,8 +100,8 @@ doLinearize :: PGF -> PGF.Tree -> Maybe PGF.Language -> JSValue
|
|||||||
doLinearize pgf tree mto = showJSON $ map toJSObject
|
doLinearize pgf tree mto = showJSON $ map toJSObject
|
||||||
[[("to",to),("text",text)] | (to,text) <- linearize' pgf mto tree]
|
[[("to",to),("text",text)] | (to,text) <- linearize' pgf mto tree]
|
||||||
|
|
||||||
doInfo :: PGF -> Maybe (Accept Language) -> JSValue
|
doGrammar :: PGF -> Maybe (Accept Language) -> JSValue
|
||||||
doInfo pgf macc = showJSON $ toJSObject
|
doGrammar pgf macc = showJSON $ toJSObject
|
||||||
[("name", showJSON (PGF.abstractName pgf)),
|
[("name", showJSON (PGF.abstractName pgf)),
|
||||||
("userLanguage", showJSON (selectLanguage pgf macc)),
|
("userLanguage", showJSON (selectLanguage pgf macc)),
|
||||||
("categories", showJSON categories),
|
("categories", showJSON categories),
|
||||||
|
|||||||
Reference in New Issue
Block a user