当前位置:网站首页>egg. JS directory structure
egg. JS directory structure
2022-07-06 08:29:00 【Liu Chu, Ge Nian】
List of articles
Directory structure
Structural view
egg-project
├── package.json
├── app.js ( Optional )
├── agent.js ( Optional )
├── app(----------- The core ------------)
| ├── router.js( route )
│ ├── controller( controller )
│ | └── home.js
│ ├── service ( Model )
│ | └── user.js
│ ├── middleware ( middleware )
│ | └── response_time.js
│ ├── schedule ( Optional )
│ | └── my_task.js
│ ├── public ( Static resources )
│ | └── reset.css
│ ├── view ( Template view )
│ | └── home.tpl
│ └── extend ( Expand )
│ ├── helper.js ( Optional )
│ ├── request.js ( Optional )
│ ├── response.js ( Optional )
│ ├── context.js ( Optional )
│ ├── application.js ( Optional )
│ └── agent.js ( Optional )
├── config
| ├── plugin.js
| ├── config.default.js
│ ├── config.prod.js
| ├── config.test.js ( Optional )
| ├── config.local.js ( Optional )
| └── config.unittest.js ( Optional )
└── test
├── middleware
| └── response_time.test.js
└── controller
└── home.test.js
The structure,
Above , The directory agreed by the framework :
app/router.jsUsed for configuration URL Routing rules , Specific see Router.app/controller/**Used to parse user input , Return corresponding results after processing , Specific see Controller.app/service/**For writing the business logic layer , Optional , It is recommended to use , Specific see Service.app/middleware/**For writing middleware , Optional , Specific see Middleware.app/public/**Used to place static resources , Optional , See the built-in plug-ins for details egg-static .app/extend/**Extension for framework , Optional , Specific see Framework extension .config/config.{env}.jsFor writing configuration files , Specific see To configure .config/plugin.jsFor configuring plug-ins that need to be loaded , Specific see plug-in unit .test/**For unit testing , Specific see unit testing .app.jsandagent.jsUsed to customize initialization at startup , Optional , Specific see Start customization . Aboutagent.jsFor more information, see Agent Mechanism .
Directory contracted by built-in plug-ins :
app/public/**Used to place static resources , Optional , See the built-in plug-ins for details egg-static .app/schedule/**For timed tasks , Optional , Specific see Timing task .
To customize your own directory specification , See Loader API
app/view/**Used to place template files , Optional , Agreed by the template plug-in , Specific see Template rendering .app/model/**For placing domain models , Optional , Agreed by domain class related plug-ins , Such as egg-sequelize .
边栏推荐
- [brush questions] top101 must be brushed in the interview of niuke.com
- 使用 BR 备份 TiDB 集群数据到兼容 S3 的存储
- 从 CSV 文件迁移数据到 TiDB
- hcip--mpls
- JVM performance tuning and practical basic theory - Part 1
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- [luatos-air551g] 6.2 repair: restart caused by line drawing
- Cisp-pte practice explanation
- JVM performance tuning and practical basic theory - Part 1
- 升级 TiDB Operator
猜你喜欢

Unified ordering background interface product description Chinese garbled

FairGuard游戏加固:游戏出海热潮下,游戏安全面临新挑战

IOT -- interpreting the four tier architecture of the Internet of things
![[research materials] 2022 China yuancosmos white paper - Download attached](/img/b4/422dff0510bbe67f3578202d6e80b7.jpg)
[research materials] 2022 China yuancosmos white paper - Download attached

Personalized online cloud database hybrid optimization system | SIGMOD 2022 selected papers interpretation
![[research materials] 2021 Research Report on China's smart medical industry - Download attached](/img/c8/a205ddc2835c87efa38808cf31f59e.jpg)
[research materials] 2021 Research Report on China's smart medical industry - Download attached

MySQL learning records 12jdbc operation transactions

【刷题】牛客网面试必刷TOP101

Pyqt5 development tips - obtain Manhattan distance between coordinates

Let the bullets fly for a while
随机推荐
China dihydrolaurenol market forecast and investment strategy report (2022 Edition)
从 CSV 文件迁移数据到 TiDB
leetcode刷题 (5.31) 字符串
leetcode刷题 (5.28) 哈希表
How to use information mechanism to realize process mutual exclusion, process synchronization and precursor relationship
Sort according to a number in a string in a column of CSV file
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
MySQL learning record 07 index (simple understanding)
Let the bullets fly for a while
PLT in Matplotlib tight_ layout()
MySQL learning record 10getting started with JDBC
Upgrade tidb operator
Summary of MySQL index failure scenarios
China polyether amine Market Forecast and investment strategy report (2022 Edition)
MySQL learning records 12jdbc operation transactions
ESP系列引脚说明图汇总
ESP series pin description diagram summary
Is it safe to open an account in Zheshang futures?
使用 TiDB Lightning 恢复 S3 兼容存储上的备份数据
Online yaml to CSV tool