Created
September 4, 2020 11:31
-
-
Save ArcanisCz/309c3bcb5665bcaa75d17be6e19ff85c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const TodoFilterChecker = Record({ | |
text: String, | |
}); | |
type TodoFilter = Static<typeof TodoFilterChecker>; | |
app.get("/todo/", async function (req: Request<any, any, any, TodoFilter>, res: Response) { | |
const a = TodoFilterChecker.check(req.query); | |
const result = await getTodos(a.text); | |
res.json(result); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment