I cannot get my angular application to run locally. I am getting an error that my interview.js and angular.js are not being found. Also, angular is not defined in the interview.js file when I open it from the dev console.
Here is my directory structure:
mock public index.html src services interview.js vendor angular.js Here is my index.html
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>Interview Practice</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="../vendor/angular.js" type="text/javascript"></script> </head> <body ng-app="interviewapp"> hello world! <script src="../src/interview.js" type="text/javascript"></script> </body> </html> Here is my interview.js
angular.module("interviewapp", []); console.log("does this work"); I'm using http-server to start the application.
Starting up http-server, serving ./public Available on: http://10.66.87.184:8080 http://192.168.56.1:8080 http://127.0.0.1:8080 Going to localhost, or any of the https listed there, this is the error I get:
http://10.66.87.184:8080/vendor/angular.js Failed to load resource: the server responded with a status of 404 (Not Found) http://10.66.87.184:8080/src/interview.js Failed to load resource: the server responded with a status of 404 (Not Found) How do I fix this so that my app runs?
srcandvendordirectories intopublicdirectory and remove the..from the start of your paths to files e.g. changesrc="../src/interview.js"tosrc="/src/interview.js"