P
P
PlasterTom2016-04-09 02:12:02
JavaScript
PlasterTom, 2016-04-09 02:12:02

How to prefix express.js virtual path?

df7c6f7553d74c179e530c2631c78fd6.jpg
Getting started with express.js
I do everything according to the instructions, but an attempt to display an image with the path virt prefix gives a 404 error. (Without the prefix, everything is displayed fine, even after writing
app.use('/static', express.static('public'));
or app.use('/static', express.static) into the app.js file (__dirname + '/public'));
What are the options to fix this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PlasterTom, 2016-04-09
@PlasterTom

restart

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question