-3

I have a html file in a folder called views, and i run my project using node. node index.js which makes a server using total.js. The server starts running on http://127.0.0.1:8000/ . This all works fine, except when I try to include a script in the html:

<script type="text/javascript" src="/path/to/js.js">

I get the following message in the console:

GET http://127.0.0.1:8000/path/to/js.js" 404 not found

user2321611
  • 1,049
  • 1
  • 7
  • 17
  • Well where is that file located? (Like, what directory?) – Pointy Nov 05 '14 at 18:11
  • I get the same message, it doesn't matter where I put the file, or the path to the file (even when they are in the same directory) – user2321611 Nov 05 '14 at 18:18
  • It means exactly what it says. You're not putting the file in the right place or the URL is not what you think it is. – Sparky Nov 05 '14 at 18:38

1 Answers1

0

Check if the file exists: /your-app-directory/public/path/to/js.js

All JavaScripts are routed to /your-app-directory/public/js/default.js by default.

Peter Sirka
  • 748
  • 5
  • 10