Skip to content

Instantly share code, notes, and snippets.

@ArcanisCz
Created September 4, 2020 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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