For example when I write <script src=files/script.js></script> in HTML document it dosen't work, but in site folder files exists.
-
1What do you mean by "it doesn't work"?kinakuta– kinakuta2011-06-19 10:20:18 +00:00Commented Jun 19, 2011 at 10:20
-
Browser get 404 error instead of files/script.js file.idzikovsky– idzikovsky2011-06-19 13:50:39 +00:00Commented Jun 19, 2011 at 13:50
Add a comment
|
2 Answers
If you're using express you need to assign a folder as the public folder
eg
server.use(express.static(__dirname + '/public'));
2 Comments
idzikovsky
Can I do it only with default modules? And I would like to get link on a article with detail description of actions that i need to do (or only detail description without link =) ).
Harry
@user805222 unsure what you're asking but it's definitely a different question. You should flesh out your questions with code samples and just other information as it's hard to know what kind of answer you're looking for. If you're looking for a node.js server tutorial just google it...