Folder structure for both server side and thick client web app

前端 未结 3 1931
一个人的身影
一个人的身影 2021-02-05 17:41

Currently I am using Node.js for the backend and either extjs or backbone for the client and I am now completely confused on the folder structure.

Using express

3条回答
  •  隐瞒了意图╮
    2021-02-05 18:21

    In your place, I would do that way:

    appname
      |--ServerCode
      |  |--controllers
      |  |--models
      |  |  |--appmodel.js
      |  |--routes
      |  |  |--router.js
      |  |--views
      |  |  |--appview.ejs
      |  |--app.js
      |--public
      |  |--css
      |  |--js // any client-side javascripts
      |  |--models
      |  |--controllers
      |  |--...
    

    The main idea is to place public folder outside of the scope of your server javascript files.

    See an example here: https://github.com/madhums/node-express-mongoose-demo/

提交回复
热议问题