当前位置:网站首页>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 .
边栏推荐
- 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
- [research materials] 2021 China online high growth white paper - Download attached
- Day29-t77 & t1726-2022-02-13-don't answer by yourself
- 移位运算符
- [research materials] 2022 enterprise wechat Ecosystem Research Report - Download attached
- [research materials] 2021 Research Report on China's smart medical industry - Download attached
- 从 CSV 文件迁移数据到 TiDB
- 图像融合--挑战、机遇与对策
- Use Alibaba icon in uniapp
- Mobile Test Engineer occupation yyds dry goods inventory
猜你喜欢
Yyds dry goods inventory three JS source code interpretation eventdispatcher
Sort according to a number in a string in a column of CSV file
Deep learning: derivation of shallow neural networks and deep neural networks
2. File operation - write
On the day of resignation, jd.com deleted the database and ran away, and the programmer was sentenced
[cloud native topic -45]:kubesphere cloud Governance - Introduction and overall architecture of enterprise container platform based on kubernetes
2022.02.13 - NC002. sort
C语言 - 位段
Bottom up - physical layer
Roguelike游戏成破解重灾区,如何破局?
随机推荐
3. File operation 3-with
Restore backup data on S3 compatible storage with br
On the day of resignation, jd.com deleted the database and ran away, and the programmer was sentenced
Use dumping to back up tidb cluster data to S3 compatible storage
Hill sort c language
C语言 - 位段
FairGuard游戏加固:游戏出海热潮下,游戏安全面临新挑战
根据csv文件某一列字符串中某个数字排序
Analysis of Top1 accuracy and top5 accuracy examples
What is the use of entering the critical point? How to realize STM32 single chip microcomputer?
hcip--mpls
【刷题】牛客网面试必刷TOP101
Vocabulary notes for postgraduate entrance examination (3)
C语言自定义类型:结构体
Grayscale upgrade tidb operator
JVM 快速入门
leetcode刷题 (5.31) 字符串
【MySQL】日志
JVM performance tuning and practical basic theory - Part 1
Mobile Test Engineer occupation yyds dry goods inventory