clwy-express-generator 5.0.8 → 5.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  [![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](http://expressjs.com/)
2
2
 
3
- [Express](https://www.npmjs.com/package/express) 应用程序生成器。
3
+ # [Express](https://www.npmjs.com/package/express) 应用程序生成器。
4
4
 
5
- 此项目是从[express-generator](https://github.com/expressjs/generator)分叉而来,并添加了一些新特性。
5
+ **此项目基于 [express-generator](https://github.com/expressjs/generator) 分叉而来,并新增了一些功能特性。**
6
+
7
+ **其中,ES6 支持的实现参考了 [Dr. Jeff Jackson](https://github.com/drjeffjackson) 提交的 [Pull Request](https://github.com/expressjs/generator/pull/316),并在其基础上进行了进一步优化和调整。**
6
8
 
7
9
  ## 功能特性
8
10
 
@@ -11,6 +13,7 @@
11
13
  - **📁 中间件模块化**:新增文件夹存放中间件。
12
14
  - **🔧 增加环境变量配置**:多环境管理更便捷。
13
15
  - **🔄 集成nodemon**:开发时自动重启服务。
16
+ - **🌐 集成CORS**:允许跨域请求。
14
17
  - **📄 新增 README.md**:包含项目简介和基本功能说明。
15
18
  - **📦 内置配置**:默认包含`.prettierrc`(代码格式化)和`.gitignore`(文件忽略)。
16
19
 
@@ -52,9 +55,11 @@ $ npm start
52
55
 
53
56
  ------------
54
57
 
55
- [Express'](https://www.npmjs.com/package/express) application generator.
58
+ # [Express'](https://www.npmjs.com/package/express) application generator.
59
+
60
+ **This project is a fork of [express-generator](https://github.com/expressjs/generator), enhanced with new features.**
56
61
 
57
- Forked from [express-generator](https://github.com/expressjs/generator), this project is a fork with some new features.
62
+ **The ES6 support was adapted and improved from [Dr Jeff Jackson](https://github.com/drjeffjackson)'s [Pull Request](https://github.com/expressjs/generator/pull/316).**
58
63
 
59
64
  ## Features
60
65
 
@@ -63,6 +68,7 @@ Forked from [express-generator](https://github.com/expressjs/generator), this pr
63
68
  - **📁 Modular Middleware**: Dedicated folder for middleware.
64
69
  - **🔧 Environment Variables**: Easier multi-environment configuration.
65
70
  - **🔄 Nodemon Integration**: Auto-restart during development.
71
+ - **🌐 CORS Integration**: Allows cross-origin requests.
66
72
  - **📄 Added basic README.md**: Describes the project as a simple Express app with static file serving and basic routing.
67
73
  - **📦 Built-in Configs**: Includes `.prettierrc` (code formatting) and `.gitignore` (file exclusion) by default.
68
74
 
@@ -106,6 +106,7 @@ function createApplication (name, dir, options, done) {
106
106
  express: '~5.1.0'
107
107
  },
108
108
  devDependencies: {
109
+ cors: '^2.8.5',
109
110
  nodemon: '^3.1.9',
110
111
  prettier: '^3.5.3'
111
112
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "clwy-express-generator",
3
3
  "description": "Express' application generator",
4
4
  "homepage": "https://github.com/clwy-cn/clwy-express-generator",
5
- "version": "5.0.8",
5
+ "version": "5.0.10",
6
6
  "author": "TJ Holowaychuk <tj@vision-media.ca>",
7
7
  "contributors": [
8
8
  "Aaron Heckmann <aaron.heckmann+github@gmail.com>",
@@ -11,6 +11,7 @@
11
11
  "Guillermo Rauch <rauchg@gmail.com>",
12
12
  "Jonathan Ong <me@jongleberry.com>",
13
13
  "Roman Shtylman <shtylman+expressjs@gmail.com>",
14
+ "Dr Jeff Jackson",
14
15
  "Liu Dong <canonpd@gmail.com>"
15
16
  ],
16
17
  "keywords": [
@@ -28,6 +28,9 @@ app.set('view engine', '<%- view.engine %>');
28
28
  app.use(<%- use %>);
29
29
  <% }); -%>
30
30
 
31
+ // CORS
32
+ app.use(cors());
33
+
31
34
  // routes
32
35
  app.use(routes);
33
36
 
@@ -32,6 +32,9 @@ app.set('view engine', '<%- view.engine %>')
32
32
  app.use(<%- use %>)
33
33
  <% }) -%>
34
34
 
35
+ // CORS
36
+ app.use(cors())
37
+
35
38
  // routes
36
39
  app.use(routes)
37
40