1 Star 0 Fork 0

SmileSB101 / beidou

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
directory-struct.md 3.53 KB
一键复制 编辑 原始数据 按行查看 历史

Directory Layout

Before you start, take a moment to see how the project structure looks like:

. helloweb
├── package.json
├── app.js (optional)
├── agent.js (optional)
├── app (application source code dir)
|   ├── router.js
│   ├── controller
│   │   └── home.js
|   ├── extend (optional,extends Beidou.Application)
│   |   ├── helper.js (optional)
│   |   ├── filter.js (optional)
│   |   ├── request.js (optional)
│   |   ├── response.js (optional)
│   |   ├── context.js (optional)
│   |   ├── application.js (optional)
│   |   └── agent.js (optional)
│   ├── proxy (optional)
|   ├── public (optional)
|   |   ├── favicon.ico
|   |   └── ...
│   ├── service (optional)
│   ├── middleware (optional)
│   │   └── response_time.js
│   └── views (optional)
|       ├── layout.html
│       └── home.html
├── config (application config dir)
|   ├── config.default.js
│   ├── config.prod.js
|   ├── config.test.js (optional)
|   ├── config.local.js (optional)
|   ├── config.unittest.js (optional)
│   ├── plugin.js
│   └── role.js (optional,role plugin for example,special config could save in this dir)
│   └── webpack.config.js (optional, custom webpack config)
├── client (client source code dir)
|   ├── index.jsx
|   └── page/index.jsx
└── test (test file dir)
    ├── middleware
    |   └── response_time.test.js
    └── controller
        └── home.test.js

As above, directories by conventions of framework:

  • app/router.js used to configure URL routing rules, see Router for details.
  • app/controller/** used to parse the input from user, return the corresponding results after processing, see Controller for details.
  • app/service/** used for business logic layer, optional, recommend to use,see Service for details.
  • app/middleware/** uesd for middleware, optional, see Middleware for details.
  • app/public/** used to place static resources, optional, see built-in plugin egg-static for details.
  • app/schedule/** used for scheduled tasks, optional, see Scheduled Task for details.
  • app/extend/** used for extensions of the framework, optional, see Extend EGG for details.
  • client/** react application for ismorphic render.
  • config/config.{env}.js used to write configuration files, see Configuration for details.
  • config/plugin.js used to configure the plugins that need to be loaded, see Plugin for details.
  • test/** used for unit test, see Unit Test for details.
  • app.js and agent.js are used to customize the initialization works at startup, see Application Startup Configuration for details. For the role of agent.js see Agent Mechanism.

To customize your own directory specification, see Loader API

  • app/view/** used to place view files, optional, by view plugins conventions, see View Rendering for details.
  • app/model/** used to place the domain model, optional, by the domain related plugins conventions, such as egg-sequelize.
1
https://gitee.com/SmileSB101/beidou.git
git@gitee.com:SmileSB101/beidou.git
SmileSB101
beidou
beidou
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891