Cannot GET / Nodejs Error

后端 未结 4 1205
面向向阳花
面向向阳花 2020-12-16 16:06

I\'m using the tutorial found here: http://addyosmani.github.io/backbone-fundamentals/#create-a-simple-web-server and added the following code.

// Module dep         


        
4条回答
  •  半阙折子戏
    2020-12-16 16:39

    Have you checked your folder structure? It seems to me like Express can't find your root directory, which should be a a folder named "site" right under your default directory. Here is how it should look like, according to the tutorial:

    node_modules/
      .bin/
      express/
      mongoose/
      path/
    site/
      css/
      img/
      js/
      index.html
    package.json
    

    For example on my machine, I started getting the same error as you when I renamed my "site" folder as something else. So I would suggest you check that you have the index.html page inside a "site" folder that sits on the same path as your server.js file.

    Hope that helps!

提交回复
热议问题