B
B
B1dloKoder2020-08-18 01:15:55
JavaScript
B1dloKoder, 2020-08-18 01:15:55

How to properly organize the work of express.static?

app.use(express.static(__dirname + './../public'));


Spits out index.html but doesn't load js and css.

5f3b046cbc322869297593.jpeg

This is how it works

app.use("/lol", express.static(__dirname + './../public'));


5f3b01f1bb3d5728134400.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cython, 2020-08-18
@cython

Remove trailing slash from static calls

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question