express-generator-typescript 2.4.14 → 2.4.17
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/lib/express-generator-typescript.js +1 -1
- package/lib/project-files/.eslintignore +1 -0
- package/lib/project-files/README.md +3 -11
- package/lib/project-files/dotenv.config.js +16 -0
- package/lib/project-files/nodemon.json +10 -0
- package/lib/project-files/nodemon.spec.json +6 -0
- package/lib/project-files/package.json +6 -15
- package/lib/project-files/spec/index.ts +3 -24
- package/lib/project-files/spec/tests/users.spec.ts +3 -3
- package/lib/project-files/src/common/classes.ts +32 -0
- package/lib/project-files/src/index.ts +0 -1
- package/lib/project-files/src/models/User.ts +4 -5
- package/lib/project-files/src/routes/UserRoutes.ts +8 -7
- package/lib/project-files/src/routes/common/check.ts +143 -0
- package/lib/project-files/src/routes/common/types.ts +3 -7
- package/lib/project-files/src/routes/index.ts +6 -29
- package/lib/project-files/src/server.ts +1 -1
- package/lib/project-files/src/services/UserService.ts +1 -1
- package/lib/project-files-auth/.eslintignore +1 -0
- package/lib/project-files-auth/README.md +3 -11
- package/lib/project-files-auth/build.ts +2 -2
- package/lib/project-files-auth/dotenv.config.js +16 -0
- package/lib/project-files-auth/nodemon.json +10 -0
- package/lib/project-files-auth/nodemon.spec.json +6 -0
- package/lib/project-files-auth/package.json +6 -15
- package/lib/project-files-auth/spec/index.ts +3 -24
- package/lib/project-files-auth/spec/tests/users.spec.ts +3 -3
- package/lib/project-files-auth/src/common/classes.ts +31 -0
- package/lib/project-files-auth/src/index.ts +0 -1
- package/lib/project-files-auth/src/models/User.ts +2 -3
- package/lib/project-files-auth/src/routes/AuthRoutes.ts +4 -12
- package/lib/project-files-auth/src/routes/UserRoutes.ts +8 -6
- package/lib/project-files-auth/src/routes/common/check.ts +143 -0
- package/lib/project-files-auth/src/routes/common/types.ts +4 -31
- package/lib/project-files-auth/src/routes/index.ts +11 -44
- package/lib/project-files-auth/src/server.ts +3 -3
- package/lib/project-files-auth/src/services/AuthService.ts +1 -1
- package/lib/project-files-auth/src/services/UserService.ts +1 -1
- package/lib/project-files-auth/src/util/SessionUtil.ts +6 -6
- package/package.json +1 -1
- package/lib/project-files/spec/nodemon.json +0 -6
- package/lib/project-files/src/common/RouteError.ts +0 -20
- package/lib/project-files/src/pre-start.ts +0 -37
- package/lib/project-files-auth/src/common/RouteError.ts +0 -20
- package/lib/project-files-auth/src/pre-start.ts +0 -37
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pre-start is where we want to place things that must run BEFORE the express
|
|
3
|
-
* server is started. This is useful for environment variables, command-line
|
|
4
|
-
* arguments, and cron-jobs.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// NOTE: DO NOT IMPORT ANY SOURCE CODE HERE
|
|
8
|
-
import path from 'path';
|
|
9
|
-
import dotenv from 'dotenv';
|
|
10
|
-
import { parse } from 'ts-command-line-args';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// **** Types **** //
|
|
14
|
-
|
|
15
|
-
interface IArgs {
|
|
16
|
-
env: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// **** Setup **** //
|
|
21
|
-
|
|
22
|
-
// Command line arguments
|
|
23
|
-
const args = parse<IArgs>({
|
|
24
|
-
env: {
|
|
25
|
-
type: String,
|
|
26
|
-
defaultValue: 'development',
|
|
27
|
-
alias: 'e',
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// Set the env file
|
|
32
|
-
const result2 = dotenv.config({
|
|
33
|
-
path: path.join(__dirname, `../env/${args.env}.env`),
|
|
34
|
-
});
|
|
35
|
-
if (result2.error) {
|
|
36
|
-
throw result2.error;
|
|
37
|
-
}
|