Код: Выделить всё
app.use("/events", eventsRoutes);
Код: Выделить всё
//...
router.get("/user/:userId", (req, res) => { // {
event.date = new Date(date);
eventsArray.push(event);
});
}
res.status(200).json(eventsArray);
});
// ...
Код: Выделить всё
Argument of type '(req: Request, res: Response) => Response | undefined' is not assignable to parameter of type 'Application'.
Type '(req: Request, res: Response) => Response | undefined' is missing the following properties from type 'Application': init, defaultConfiguration, engine, set, and 63 more.
Подробнее здесь: https://stackoverflow.com/questions/793 ... e-handlers
Мобильная версия