Im using node.js + express + typescript, and I want to get GET params. I have this so far
app.get('/top_games', (req, res) => {
const page = req.route.page;
const offset = req.route.offset;
const game_data = DAO_GAME.GetTopGuilds(100, 0);
res.send({
total : game_data[0],
data : game_data[1]
});
});
but the eslint complains for
const page = req.route.page;
const offset = req.route.offset;
saying
Unsafe assignment of an any value.eslint@typescript-eslint/no-unsafe-assignment
Unsafe member access .page on an any value.eslint@typescript-eslint/no-unsafe-member-access
How can I fix this?
req.paramsgets me{}, the data is inreq.query