Answer the question
In order to leave comments, you need to log in
How to specify the path of static files and process them on the server?
There is a
-static
folder There is a
-server folder There is a
-pages
folder
Path to pages is specified
Output file = fs.readFileSync(path.join(__dirname, '../../pages/') + 'index.html', 'utf8 ');
The server returns index.html, but does not return styles and images
Although there is a code above
path.join(__dirname, '../../pages/');
app.use(express.static(path.join(__dirname, '../../static/')));
<img src="/public/img/images/po.png">
server
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question