clwy-express-generator 5.0.11 → 5.0.13

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/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.11",
5
+ "version": "5.0.13",
6
6
  "author": "TJ Holowaychuk <tj@vision-media.ca>",
7
7
  "contributors": [
8
8
  "Aaron Heckmann <aaron.heckmann+github@gmail.com>",
package/templates/env.ejs CHANGED
@@ -1,2 +1,3 @@
1
1
  # your environment variables
2
+ NODE_ENV=development
2
3
  PORT=3000
@@ -3,14 +3,11 @@ var path = require('path');
3
3
  <% Object.keys(modules).sort().forEach(function (variable) { -%>
4
4
  var <%- variable %> = require('<%- modules[variable] %>');
5
5
  <% }); -%>
6
-
6
+ require('dotenv').config();
7
7
  <% if (view) { -%>
8
8
  var createError = require('http-errors');
9
9
  var errorHandler = require('./middlewares/error-handler');
10
10
  <% } -%>
11
-
12
- // environment variables
13
- require('dotenv').config();
14
11
  var routes = require('./config/routes');
15
12
 
16
13
  var app = express();
@@ -1,22 +1,18 @@
1
+ import express from 'express'
1
2
  import path from 'path'
2
3
  import { fileURLToPath } from 'url'
3
-
4
- import express from 'express'
5
4
  <% Object.keys(modules).sort().forEach(function (variable) { -%>
6
5
  import <%- variable %> from '<%- modules[variable] %>'
7
6
  <% }) -%>
8
-
7
+ import 'dotenv/config'
9
8
  <% if (view) { -%>
10
9
  import createError from 'http-errors'
11
10
  import errorHandler from './middlewares/error-handler.js'
12
11
  <% } -%>
13
-
14
- // environment variables
15
- import 'dotenv/config'
16
12
  import routes from './config/routes.js'
17
13
 
18
- const __dirname = path.dirname(fileURLToPath(import.meta.url))
19
14
  const app = express()
15
+ const __dirname = path.dirname(fileURLToPath(import.meta.url))
20
16
 
21
17
  <% if (view) { -%>
22
18
  // view engine setup