Se0ng11
Se0ng11

Reputation: 2333

Node red httpstatic not working

Kinda new to node-red, still puzzling on how to serve the static files

in setting.js, i had set the httpstatic to point onto a folder

 httpStatic: 'C:\public',

in the folder, it contain a file name sprite.png

i had restart node red, and run the testing page which the node have

msg.payload = "<html>Test</html><img src=\"sprite.png\"></html>"
return msg;

still i hit file not found

GET http://localhost:1880/sprite.png 404 (Not Found)

what actually goes wrong?

Upvotes: 2

Views: 2543

Answers (1)

knolleary
knolleary

Reputation: 10117

You need to escape the \ character in the path:

httpStatic: 'C:\\public',

Upvotes: 4

Related Questions