Skip to content

Instantly share code, notes, and snippets.

@ArcanisCz
Created September 4, 2020 11:31
Show Gist options
  • Save ArcanisCz/309c3bcb5665bcaa75d17be6e19ff85c to your computer and use it in GitHub Desktop.
Save ArcanisCz/309c3bcb5665bcaa75d17be6e19ff85c to your computer and use it in GitHub Desktop.
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