Answer the question
In order to leave comments, you need to log in
How to specify the correct path to the file?
The project structure is this:
db.json:
{
"products": [
{
"_id": "321sd",
"img": "./src/assets/images/product/p1.png",
"name": "Мужские Кроссовки Nike Blazer Mid Suede",
"price": 12999
}
]
}
http://localhost:5000/products
Answer the question
In order to leave comments, you need to log in
./
is the current folder.
Given that you have a localhost, as well as a project running, not quite sure what, you need to figure out which folder is considered current at the time the problem occurs.
I believe that the pictures are searched for at
http://localhost:5000/products/src/assets/images/product/p1.png
, but I can't say for sure. ./
Will not work in strict . /
- it will be the root of the site.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question