lundi 30 mars 2015

nodejs/express include local js file

New to node/express so bare with me.


Here is my current folder structure


css app.css js app.js node-modules index.html node-server.js package.json


The node-server is hosting index.html, but I cant figure out how to get the app.js and app.css files to get loaded.


index.html loads them with


<script src="js/app.js"></script> <link rel="stylesheet" type="text/css" href="css/app.css"/>


Here is the error message:


Failed to load resource: the server responded with a status of 404 (Not Found) 2http://localhost:3000/css/app.css Failed to load resource: the server responded with a status of 404 (Not Found)


I know i need to require or load module or something, just cant figure out what.


Thanks


Aucun commentaire:

Enregistrer un commentaire