当前位置:网站首页>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.js
Used 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}.js
For writing configuration files , Specific see To configure .config/plugin.js
For configuring plug-ins that need to be loaded , Specific see plug-in unit .test/**
For unit testing , Specific see unit testing .app.js
andagent.js
Used to customize initialization at startup , Optional , Specific see Start customization . Aboutagent.js
For 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 .
边栏推荐
- All the ArrayList knowledge you want to know is here
- 从 CSV 文件迁移数据到 TiDB
- 2022.02.13 - NC003. Design LRU cache structure
- Research Report on supply and demand and development prospects of China's high purity aluminum market (2022 Edition)
- leetcode刷题 (5.29) 哈希表
- 使用 BR 备份 TiDB 集群数据到兼容 S3 的存储
- Research and investment forecast report of citronellol industry in China (2022 Edition)
- String to leading 0
- China polyether amine Market Forecast and investment strategy report (2022 Edition)
- Introduction to backup and recovery Cr
猜你喜欢
【云原生】手把手教你搭建ferry开源工单系统
tree树的精准查询
Leetcode question brushing (5.28) hash table
ESP系列引脚说明图汇总
matplotlib. Widgets are easy to use
JVM performance tuning and practical basic theory - Part 1
2022 Inner Mongolia latest water conservancy and hydropower construction safety officer simulation examination questions and answers
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
游戏解包的危害及资源加密的重要性
2022.02.13 - NC002. sort
随机推荐
指针和数组笔试题解析
Résumé des diagrammes de description des broches de la série ESP
Cisp-pte practice explanation
[research materials] 2021 Research Report on China's smart medical industry - Download attached
ESP系列引脚说明图汇总
Nacos Development Manual
按位逻辑运算符
Remote storage access authorization
MySQL learning record 07 index (simple understanding)
Day29-t77 & t1726-2022-02-13-don't answer by yourself
1204 character deletion operation (2)
Restore backup data on S3 compatible storage with tidb lightning
China high purity silver nitrate Market Research and investment strategy report (2022 Edition)
C语言自定义类型:结构体
JVM 快速入门
Leetcode question brushing (5.28) hash table
Colorlog combined with logging to print colored logs
Ruffian Heng embedded bimonthly, issue 49
Wincc7.5 download and installation tutorial (win10 system)
logback1.3. X configuration details and Practice