79080798

Date: 2024-10-12 10:29:58
Score: 0.5
Natty:
Report link

The simplest solution will be:

const path = require("path");
const imageUrl = path.relative(__dirname, req.file.path);

With the help of pathh.relative pre-built function you will be able to extract the relative path easily.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Med Oussema Zaier