I have this router in my code
fastify.get('/:link', (req, reply) => {
req.params.url = req.host+req.url;
reply.view("template.ejs",req.params);
});
I am trying to catch URLs and handle them in the template. The URLs are all encodeURIComponent
escaped. for some reason, some URLs would return a 404 not found and I am not sure why.
This is the link that worked.
and this is the one that didn't work.
the error is
{
"message": "Route GET:/https%3A%2F%2Fs7386.pcdn.co%2Fwp-content%2Fuploads%2F2016%2F07%2Fadd-on-direct-link-tracking-771x386.png not found",
"error": "Not Found",
"statusCode": 404
}
I am using windows 10 with node v12.8.0 and fastify 2.8.0