clwy-express-generator 5.0.10 → 5.0.11
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/bin/express-cli.js
CHANGED
|
@@ -25,10 +25,9 @@ const args = parseArgs(process.argv.slice(2), {
|
|
|
25
25
|
f: 'force',
|
|
26
26
|
h: 'help',
|
|
27
27
|
H: 'hogan',
|
|
28
|
-
v: 'view'
|
|
29
|
-
o: 'orm'
|
|
28
|
+
v: 'view'
|
|
30
29
|
},
|
|
31
|
-
boolean: ['ejs', 'es6', 'force', 'git', 'hbs', 'help', 'hogan', 'pug', 'version'
|
|
30
|
+
boolean: ['ejs', 'es6', 'force', 'git', 'hbs', 'help', 'hogan', 'pug', 'version'],
|
|
32
31
|
default: { css: true, view: true },
|
|
33
32
|
string: ['css', 'view'],
|
|
34
33
|
unknown: function (s) {
|
|
@@ -141,8 +140,9 @@ function createApplication (name, dir, options, done) {
|
|
|
141
140
|
app.locals.uses.push('cookieParser()')
|
|
142
141
|
pkg.dependencies['cookie-parser'] = '~1.4.7'
|
|
143
142
|
|
|
144
|
-
//
|
|
145
|
-
|
|
143
|
+
// CORS
|
|
144
|
+
app.locals.modules.cors = 'cors'
|
|
145
|
+
app.locals.uses.push('cors()')
|
|
146
146
|
|
|
147
147
|
if (dir !== '.') {
|
|
148
148
|
mkdir(dir, '.')
|
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.
|
|
5
|
+
"version": "5.0.11",
|
|
6
6
|
"author": "TJ Holowaychuk <tj@vision-media.ca>",
|
|
7
7
|
"contributors": [
|
|
8
8
|
"Aaron Heckmann <aaron.heckmann+github@gmail.com>",
|
package/templates/js/app.js.ejs
CHANGED
package/templates/mjs/app.js.ejs
CHANGED
|
@@ -16,7 +16,6 @@ import 'dotenv/config'
|
|
|
16
16
|
import routes from './config/routes.js'
|
|
17
17
|
|
|
18
18
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
19
|
-
|
|
20
19
|
const app = express()
|
|
21
20
|
|
|
22
21
|
<% if (view) { -%>
|
|
@@ -32,9 +31,6 @@ app.set('view engine', '<%- view.engine %>')
|
|
|
32
31
|
app.use(<%- use %>)
|
|
33
32
|
<% }) -%>
|
|
34
33
|
|
|
35
|
-
// CORS
|
|
36
|
-
app.use(cors())
|
|
37
|
-
|
|
38
34
|
// routes
|
|
39
35
|
app.use(routes)
|
|
40
36
|
|