Problem
Hi devs,
I am having trouble passing an id that has a '/' at the beginning.
This is the log
GET /api/v1/ GetAnimeInfo//anime/5226/tokyo-ghoul/Tokyo% 20Ghoul 404 0.466 ms - 1310
As you can see, He can not recognize two /
after GetAnimeInfo//
Isn't there a way expressjs allows me that pattern?
//id = '/anime/5226/tokyo-ghoul/'
//title = 'Tokyo Ghoul'
router.get('/GetAnimeInfo/:id([^/]+/[^/]+[^/]+/[^/])/:title' , (req , res , next) =>{
let id = req.params.id
let title = req.query.title;
api.getAnimeInfo(id , title)
.then(info =>{
res.status(200).json({
info
});
}).catch((err) =>{
console.log(err);
});
});