express-generator-typescript 2.7.8 → 2.7.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.
Files changed (43) hide show
  1. package/bin/cli.js +1 -1
  2. package/lib/project-files/README.md +65 -0
  3. package/lib/project-files/config/.env.development +15 -0
  4. package/lib/project-files/config/.env.production +15 -0
  5. package/lib/project-files/config/.env.test +14 -0
  6. package/lib/project-files/config.ts +22 -0
  7. package/lib/project-files/eslint.config.ts +100 -0
  8. package/lib/project-files/gitignore +6 -0
  9. package/lib/project-files/package.json +56 -0
  10. package/lib/project-files/scripts/build.ts +28 -0
  11. package/lib/project-files/scripts/common/utils.ts +93 -0
  12. package/lib/project-files/src/common/constants/ENV.ts +19 -0
  13. package/lib/project-files/src/common/constants/HTTP_STATUS_CODES.ts +81 -0
  14. package/lib/project-files/src/common/constants/PATHS.ts +15 -0
  15. package/lib/project-files/src/common/constants/index.ts +11 -0
  16. package/lib/project-files/src/common/util/misc.ts +11 -0
  17. package/lib/project-files/src/common/util/route-errors.ts +38 -0
  18. package/lib/project-files/src/common/util/validators.ts +14 -0
  19. package/lib/project-files/src/index.ts +27 -0
  20. package/lib/project-files/src/models/User.ts +70 -0
  21. package/lib/project-files/src/models/common/types.ts +5 -0
  22. package/lib/project-files/src/public/stylesheets/users.css +48 -0
  23. package/lib/project-files/src/repos/MockOrm.ts +63 -0
  24. package/lib/project-files/src/repos/UserRepo.ts +133 -0
  25. package/lib/project-files/src/repos/database.json +1 -0
  26. package/lib/project-files/src/repos/database.test.json +1 -0
  27. package/lib/project-files/src/routes/UserRoutes.ts +69 -0
  28. package/lib/project-files/src/routes/common/types/index.ts +10 -0
  29. package/lib/project-files/src/routes/common/util/index.ts +16 -0
  30. package/lib/project-files/src/routes/index.ts +31 -0
  31. package/lib/project-files/src/server.ts +86 -0
  32. package/lib/project-files/src/services/UserService.ts +70 -0
  33. package/lib/project-files/src/views/users.html +132 -0
  34. package/lib/project-files/tests/aux/setup.ts +26 -0
  35. package/lib/project-files/tests/common/types.ts +16 -0
  36. package/lib/project-files/tests/common/utils.ts +55 -0
  37. package/lib/project-files/tests/users.test.ts +123 -0
  38. package/lib/project-files/tsconfig.json +35 -0
  39. package/lib/project-files/tsconfig.prod.json +30 -0
  40. package/lib/project-files/vitest.config.mts +18 -0
  41. package/package.json +1 -1
  42. package/README-git +0 -78
  43. package/express-typescript.png +0 -0
package/bin/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  const path = require('path'),
4
4
  expressGenTs = require('../lib/express-generator-typescript');
@@ -0,0 +1,65 @@
1
+ ## About
2
+
3
+ This project was created with [express-generator-typescript](https://github.com/seanpmaxwell/express-generator-typescript).
4
+
5
+ **IMPORTANT** for demo purposes I had to disable `helmet` in production. In any real world app you should change these 3 lines of code in `src/server.ts`:
6
+ ```ts
7
+ // eslint-disable-next-line n/no-process-env
8
+ if (!process.env.DISABLE_HELMET) {
9
+ app.use(helmet());
10
+ }
11
+ ```
12
+
13
+ To just this:
14
+ ```ts
15
+ app.use(helmet());
16
+ ```
17
+
18
+
19
+ ## Available Scripts
20
+
21
+ ### `npm run clean-install`
22
+
23
+ Remove the existing `node_modules/` folder, `package-lock.json`, and reinstall all library modules.
24
+
25
+
26
+ ### `npm run dev` or `npm run dev:hot` (hot reloading)
27
+
28
+ Run the server in development mode.<br/>
29
+
30
+ **IMPORTANT** development mode uses `swc` for performance reasons which DOES NOT check for typescript errors. Run `npm run type-check` to check for type errors. NOTE: you should use your IDE to prevent most type errors.
31
+
32
+
33
+ ### `npm test` or `npm run test:hot` (hot reloading)
34
+
35
+ Run all unit-tests.
36
+
37
+
38
+ ### `npm test -- "name of test file" (i.e. users).`
39
+
40
+ Run a single unit-test.
41
+
42
+
43
+ ### `npm run lint`
44
+
45
+ Check for linting errors.
46
+
47
+
48
+ ### `npm run build`
49
+
50
+ Build the project for production.
51
+
52
+
53
+ ### `npm start`
54
+
55
+ Run the production build (Must be built first).
56
+
57
+
58
+ ### `npm run type-check`
59
+
60
+ Check for typescript errors.
61
+
62
+
63
+ ## Additional Notes
64
+
65
+ - If `npm run dev` gives you issues with bcrypt on MacOS you may need to run: `npm rebuild bcrypt --build-from-source`.
@@ -0,0 +1,15 @@
1
+ ## Environment ##
2
+ NODE_ENV=development
3
+
4
+
5
+ ## Server ##
6
+ PORT=3000
7
+ HOST=localhost
8
+
9
+
10
+ ## Setup jet-logger ##
11
+ JET_LOGGER_MODE=CONSOLE
12
+ JET_LOGGER_FILEPATH=jet-logger.log
13
+ JET_LOGGER_TIMESTAMP=TRUE
14
+ JET_LOGGER_FORMAT=LINE
15
+
@@ -0,0 +1,15 @@
1
+ ## Environment ##
2
+ NODE_ENV=production
3
+
4
+
5
+ ## Server ##
6
+ PORT=8081
7
+ HOST=localhost
8
+ DISABLE_HELMET=TRUE
9
+
10
+
11
+ ## Setup jet-logger ##
12
+ JET_LOGGER_MODE=FILE
13
+ JET_LOGGER_FILEPATH=jet-logger.log
14
+ JET_LOGGER_TIMESTAMP=TRUE
15
+ JET_LOGGER_FORMAT=LINE
@@ -0,0 +1,14 @@
1
+ ## Environment ##
2
+ NODE_ENV=test
3
+
4
+
5
+ ## Server ##
6
+ PORT=4000
7
+ HOST=localhost
8
+
9
+
10
+ ## Setup jet-logger ##
11
+ JET_LOGGER_MODE=CONSOLE
12
+ JET_LOGGER_FILEPATH=jet-logger.log
13
+ JET_LOGGER_TIMESTAMP=TRUE
14
+ JET_LOGGER_FORMAT=LINE
@@ -0,0 +1,22 @@
1
+ /* eslint-disable n/no-process-env */
2
+
3
+ import path from 'path';
4
+ import dotenv from 'dotenv';
5
+ import moduleAlias from 'module-alias';
6
+
7
+
8
+ // Check the env
9
+ const NODE_ENV = (process.env.NODE_ENV ?? 'development');
10
+
11
+ // Configure "dotenv"
12
+ const result2 = dotenv.config({
13
+ path: path.join(__dirname, `./config/.env.${NODE_ENV}`),
14
+ });
15
+ if (result2.error) {
16
+ throw result2.error;
17
+ }
18
+
19
+ // Configure moduleAlias
20
+ if (__filename.endsWith('js')) {
21
+ moduleAlias.addAlias('@src', __dirname + '/dist');
22
+ }
@@ -0,0 +1,100 @@
1
+ import eslint from '@eslint/js';
2
+ import tseslint from 'typescript-eslint';
3
+ import stylistic from '@stylistic/eslint-plugin';
4
+ import nodePlugin from 'eslint-plugin-n';
5
+ import { defineConfig } from 'eslint/config';
6
+
7
+ export default defineConfig(
8
+ eslint.configs.recommended,
9
+ nodePlugin.configs['flat/recommended-script'],
10
+ ...tseslint.configs.strictTypeChecked,
11
+ ...tseslint.configs.stylisticTypeChecked,
12
+ {
13
+ ignores: [
14
+ '**/node_modules/*',
15
+ '**/*.mjs',
16
+ '**/*.js',
17
+ ],
18
+ },
19
+ {
20
+ languageOptions: {
21
+ parserOptions: {
22
+ project: './tsconfig.json',
23
+ warnOnUnsupportedTypeScriptVersion: false,
24
+ },
25
+ },
26
+ },
27
+ {
28
+ plugins: {
29
+ '@stylistic': stylistic,
30
+ },
31
+ },
32
+ {
33
+ files: ['**/*.ts'],
34
+ },
35
+ {
36
+ rules: {
37
+ '@typescript-eslint/explicit-member-accessibility': 'warn',
38
+ '@typescript-eslint/no-misused-promises': 0,
39
+ '@typescript-eslint/no-floating-promises': 0,
40
+ '@typescript-eslint/no-confusing-void-expression': 0,
41
+ '@typescript-eslint/no-unnecessary-condition': 0,
42
+ '@typescript-eslint/restrict-template-expressions': [
43
+ 'error', { allowNumber: true },
44
+ ],
45
+ '@typescript-eslint/restrict-plus-operands': [
46
+ 'warn', { allowNumberAndString: true },
47
+ ],
48
+ '@typescript-eslint/no-unused-vars': [
49
+ 'warn',
50
+ {
51
+ argsIgnorePattern: '^_',
52
+ varsIgnorePattern: '^_',
53
+ },
54
+ ],
55
+ '@typescript-eslint/no-unsafe-enum-comparison': 0,
56
+ '@typescript-eslint/no-unnecessary-type-parameters': 0,
57
+ '@stylistic/no-extra-semi': 'warn',
58
+ 'max-len': [
59
+ 'warn',
60
+ {
61
+ 'code': 80,
62
+ },
63
+ ],
64
+ '@stylistic/semi': ['warn', 'always'],
65
+ '@stylistic/member-delimiter-style': ['warn', {
66
+ 'multiline': {
67
+ 'delimiter': 'comma',
68
+ 'requireLast': true,
69
+ },
70
+ 'singleline': {
71
+ 'delimiter': 'comma',
72
+ 'requireLast': false,
73
+ },
74
+ 'overrides': {
75
+ 'interface': {
76
+ 'singleline': {
77
+ 'delimiter': 'semi',
78
+ 'requireLast': false,
79
+ },
80
+ 'multiline': {
81
+ 'delimiter': 'semi',
82
+ 'requireLast': true,
83
+ },
84
+ },
85
+ },
86
+ }],
87
+ '@typescript-eslint/no-non-null-assertion': 0,
88
+ '@typescript-eslint/no-unused-expressions': 'warn',
89
+ 'comma-dangle': ['warn', 'always-multiline'],
90
+ 'no-console': 1,
91
+ 'no-extra-boolean-cast': 0,
92
+ 'indent': ['warn', 2],
93
+ 'quotes': ['warn', 'single'],
94
+ 'n/no-process-env': 1,
95
+ 'n/no-missing-import': 0,
96
+ 'n/no-unpublished-import': 0,
97
+ 'prefer-const': 'warn',
98
+ },
99
+ },
100
+ );
@@ -0,0 +1,6 @@
1
+ **/node_modules
2
+ dist/
3
+ temp/
4
+ **/**/*.log
5
+ config.js
6
+ tsconfig.tsbuildinfo
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "express-typescript-example",
3
+ "version": "0.0.0",
4
+ "scripts": {
5
+ "build": "ts-node ./scripts/build.ts",
6
+ "clean-install": "rm -rf ./node_modules && rm -r package-lock.json && npm i",
7
+ "dev": "NODE_ENV=development ts-node ./src",
8
+ "dev:hot": "nodemon --exec \"npm run dev\" --watch ./src --ext .ts",
9
+ "lint": "eslint .",
10
+ "start": "NODE_ENV=production node -r ./config.js ./dist",
11
+ "test": "NODE_ENV=test vitest",
12
+ "type-check": "tsc -b --noEmit"
13
+ },
14
+ "engines": {
15
+ "node": ">=16.0.0"
16
+ },
17
+ "dependencies": {
18
+ "cookie-parser": "^1.4.7",
19
+ "dayjs": "^1.11.13",
20
+ "dotenv": "^16.5.0",
21
+ "express": "^5.1.0",
22
+ "helmet": "^8.1.0",
23
+ "jet-env": "^1.1.4",
24
+ "jet-logger": "^2.1.1",
25
+ "jet-paths": "^2.0.1",
26
+ "jet-validators": "^2.0.9",
27
+ "jsonfile": "^6.1.0",
28
+ "module-alias": "^2.2.3",
29
+ "morgan": "^1.10.0"
30
+ },
31
+ "devDependencies": {
32
+ "@eslint/js": "^9.25.1",
33
+ "@stylistic/eslint-plugin": "^5.5.0",
34
+ "@swc/core": "^1.11.22",
35
+ "@types/cookie-parser": "^1.4.8",
36
+ "@types/find": "^0.2.4",
37
+ "@types/fs-extra": "^11.0.4",
38
+ "@types/jsonfile": "^6.1.4",
39
+ "@types/module-alias": "^2.0.4",
40
+ "@types/morgan": "^1.9.9",
41
+ "@types/node": "^22.14.1",
42
+ "@types/supertest": "^6.0.3",
43
+ "eslint": "^9.25.1",
44
+ "eslint-plugin-n": "^17.17.0",
45
+ "find": "^0.3.0",
46
+ "fs-extra": "^11.3.0",
47
+ "jiti": "^2.4.2",
48
+ "nodemon": "^3.1.10",
49
+ "supertest": "^7.1.0",
50
+ "ts-node": "^10.9.2",
51
+ "tsconfig-paths": "^4.2.0",
52
+ "typescript": "^5.8.3",
53
+ "typescript-eslint": "^8.32.0",
54
+ "vitest": "^3.1.2"
55
+ }
56
+ }
@@ -0,0 +1,28 @@
1
+ import logger from 'jet-logger';
2
+ import { copy, copyFilesRec, exec, remove } from './common/utils';
3
+
4
+ /******************************************************************************
5
+ Run
6
+ ******************************************************************************/
7
+
8
+ /**
9
+ * Start
10
+ */
11
+ (async () => {
12
+ try {
13
+ // Remove current build
14
+ await remove('./dist/');
15
+ await exec('npm run lint', '../');
16
+ await exec('tsc --project tsconfig.prod.json', '../');
17
+ // Copy
18
+ await copyFilesRec('./src', './dist', ['.ts']);
19
+ await copy('./temp/config.js', './config.js');
20
+ await copy('./temp/src', './dist');
21
+ await remove('./temp/');
22
+ } catch (err) {
23
+ logger.err(err);
24
+ // eslint-disable-next-line n/no-process-exit
25
+ process.exit(1);
26
+ }
27
+ })();
28
+
@@ -0,0 +1,93 @@
1
+ import fs from 'fs-extra';
2
+ import logger from 'jet-logger';
3
+ import childProcess from 'child_process';
4
+ import path from 'path';
5
+
6
+ /******************************************************************************
7
+ Functions
8
+ *******************************************************************************
9
+
10
+ /**
11
+ * Copy file.
12
+ */
13
+ export function copy(src: string, dest: string): Promise<void> {
14
+ return new Promise((res, rej) => {
15
+ return fs.copy(src, dest, err => {
16
+ return (!!err ? rej(err) : res());
17
+ });
18
+ });
19
+ }
20
+
21
+ /**
22
+ * Remove file
23
+ */
24
+ export function remove(loc: string): Promise<void> {
25
+ return new Promise((res, rej) => {
26
+ return fs.remove(loc, err => {
27
+ return (!!err ? rej(err) : res());
28
+ });
29
+ });
30
+ }
31
+
32
+ /**
33
+ * Run command-line command.
34
+ */
35
+ export function exec(cmd: string, loc = './'): Promise<string> {
36
+ // Setup directory
37
+ const callingDir = path.dirname(require.main?.filename ?? './'),
38
+ cwd = path.join(callingDir, loc);
39
+ // Wrap in promise
40
+ return new Promise((res, rej) =>
41
+ childProcess.exec(cmd, { cwd }, (err, stdout, stderr) => {
42
+ if (!!stdout) {
43
+ logger.info(stdout);
44
+ }
45
+ if (!!stderr) {
46
+ logger.err(stderr);
47
+ }
48
+ if (!!err) {
49
+ return rej(err);
50
+ } else if (!!stderr) {
51
+ return rej(new Error(stderr));
52
+ } else {
53
+ return res(stdout);
54
+ }
55
+ }),
56
+ );
57
+ }
58
+
59
+ /**
60
+ * Recursively search for a folder for all files and copy them to the new
61
+ * destination keeping their paths relative to the "src" param.
62
+ *
63
+ * Example:
64
+ * If file "./src/foo/bar.txt" exists then:
65
+ * copyFilesRec('./src', './dest') => ["./dest/foo/bar.txt"]
66
+ *
67
+ * @param excludeExt Exlude a list of file extensions.
68
+ */
69
+ export async function copyFilesRec(
70
+ src: string,
71
+ dest: string,
72
+ excludeExt?: string[],
73
+ ): Promise<void> {
74
+ const copyReqs: Promise<void>[] = [];
75
+ try {
76
+ const entries = await fs.readdir(src, { withFileTypes: true });
77
+ for (const entry of entries) {
78
+ const currPath = src + '/' + entry.name,
79
+ currDest = dest + '/' + entry.name,
80
+ ext = path.extname(entry.name);
81
+ if (entry.isFile() && !excludeExt?.includes(ext)) {
82
+ const req = fs.copy(currPath, currDest);
83
+ copyReqs.push(req);
84
+ } else if (entry.isDirectory()) {
85
+ const req = copyFilesRec(currPath, currDest, excludeExt);
86
+ copyReqs.push(req);
87
+ }
88
+ }
89
+ } catch (error) {
90
+ logger.err(`Error searching in ${src}: ` + String(error));
91
+ }
92
+ await Promise.all(copyReqs);
93
+ }
@@ -0,0 +1,19 @@
1
+ import jetEnv, { num } from 'jet-env';
2
+ import { isValueOf } from 'jet-validators';
3
+
4
+ import { NODE_ENVS } from '.';
5
+
6
+ /******************************************************************************
7
+ Setup
8
+ ******************************************************************************/
9
+
10
+ const ENV = jetEnv({
11
+ NodeEnv: isValueOf(NODE_ENVS),
12
+ Port: num,
13
+ });
14
+
15
+ /******************************************************************************
16
+ Export default
17
+ ******************************************************************************/
18
+
19
+ export default ENV;
@@ -0,0 +1,81 @@
1
+ /* eslint-disable max-len */
2
+
3
+ import { ValueOf } from 'jet-validators';
4
+
5
+
6
+ /**
7
+ * Hypertext Transfer Protocol (HTTP) response status codes.
8
+ * @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
9
+ *
10
+ * This file was copied from here: https://gist.github.com/scokmen/f813c904ef79022e84ab2409574d1b45
11
+ */
12
+ const HTTP_STATUS_CODES = {
13
+ Continue: 100,
14
+ SwitchingProtocols: 101,
15
+ Processing: 102,
16
+ Ok: 200,
17
+ Created: 201,
18
+ Accepted: 202,
19
+ NonAuthoritativeInformation: 203,
20
+ NoContent: 204,
21
+ ResetContent: 205,
22
+ PartialContent: 206,
23
+ MultiStatus: 207,
24
+ AlreadyReported: 208,
25
+ ImUsed: 226,
26
+ MultipleChoices: 300,
27
+ MovedPermanently: 301,
28
+ Found: 302,
29
+ SeeOther: 303,
30
+ NotModified: 304,
31
+ UseProxy: 305,
32
+ SwitchProxy: 306,
33
+ TemporaryRedirect: 307,
34
+ PermanentRedirect: 308,
35
+ BadRequest: 400,
36
+ Unauthorized: 401,
37
+ PaymentRequired: 402,
38
+ Forbidden: 403,
39
+ NotFound: 404,
40
+ MethodNotAllowed: 405,
41
+ NotAcceptable: 406,
42
+ ProxyAuthenticationRequired: 407,
43
+ RequestTimeout: 408,
44
+ Conflict: 409,
45
+ Gone: 410,
46
+ LengthRequired: 411,
47
+ PreconditionFailed: 412,
48
+ PayloadTooLarge: 413,
49
+ UriTooLong: 414,
50
+ UnsupportedMediaType: 415,
51
+ RangeNotSatisfiable: 416,
52
+ ExpectationFailed: 417,
53
+ IamaTeapot: 418,
54
+ MisdirectedRequest: 421,
55
+ UnprocessableEntity: 422,
56
+ Locked: 423,
57
+ FailedDependency: 424,
58
+ UpgradeRequired: 426,
59
+ PreconditionRequired: 428,
60
+ TooManyRequests: 429,
61
+ RequestHeaderFieldsTooLarge: 431,
62
+ UnavailableForLegalReasons: 451,
63
+ InternalServerError: 500,
64
+ NotImplemented: 501,
65
+ BadGateway: 502,
66
+ ServiceUnavailable: 503,
67
+ GatewayTimeout: 504,
68
+ HttpVersionNotSupported: 505,
69
+ VariantAlsoNegotiates: 506,
70
+ InsuffientStorage: 507,
71
+ LoopDetected: 508,
72
+ NotExtended: 510,
73
+ NetworkAuthenticationRequired: 511,
74
+ } as const;
75
+
76
+ /******************************************************************************
77
+ Export default
78
+ ******************************************************************************/
79
+
80
+ export type HttpStatusCodes = ValueOf<typeof HTTP_STATUS_CODES>;
81
+ export default HTTP_STATUS_CODES;
@@ -0,0 +1,15 @@
1
+ import jetPaths from 'jet-paths';
2
+
3
+ const PATHS = {
4
+ _: '/api',
5
+ Users: {
6
+ _: '/users',
7
+ Get: '/all',
8
+ Add: '/add',
9
+ Update: '/update',
10
+ Delete: '/delete/:id',
11
+ },
12
+ } as const;
13
+
14
+ export const JET_PATHS = jetPaths(PATHS);
15
+ export default PATHS;
@@ -0,0 +1,11 @@
1
+
2
+ /******************************************************************************
3
+ Constants
4
+ ******************************************************************************/
5
+
6
+ // NOTE: These need to match the names of your ".env" files
7
+ export const NODE_ENVS = {
8
+ Dev: 'development',
9
+ Test: 'test',
10
+ Production: 'production',
11
+ } as const;
@@ -0,0 +1,11 @@
1
+
2
+ /******************************************************************************
3
+ Functions
4
+ ******************************************************************************/
5
+
6
+ /**
7
+ * Get a random number between 1 and 1,000,000,000,000
8
+ */
9
+ export function getRandomInt(): number {
10
+ return Math.floor(Math.random() * 1_000_000_000_000);
11
+ }
@@ -0,0 +1,38 @@
1
+ import { ParseError } from 'jet-validators/utils';
2
+
3
+ import HTTP_STATUS_CODES, {
4
+ HttpStatusCodes,
5
+ } from '@src/common/constants/HTTP_STATUS_CODES';
6
+
7
+ /******************************************************************************
8
+ Classes
9
+ ******************************************************************************/
10
+
11
+ /**
12
+ * Error with status code and message.
13
+ */
14
+ export class RouteError extends Error {
15
+ public status: HttpStatusCodes;
16
+
17
+ public constructor(status: HttpStatusCodes, message: string) {
18
+ super(message);
19
+ this.status = status;
20
+ }
21
+ }
22
+
23
+ /**
24
+ * Handle "parseObj" errors.
25
+ */
26
+ export class ValidationError extends RouteError {
27
+
28
+ public static MESSAGE = 'The parseObj() function discovered one or ' +
29
+ 'more errors.';
30
+
31
+ public constructor(errors: ParseError[]) {
32
+ const msg = JSON.stringify({
33
+ message: ValidationError.MESSAGE,
34
+ errors,
35
+ });
36
+ super(HTTP_STATUS_CODES.BadRequest, msg);
37
+ }
38
+ }
@@ -0,0 +1,14 @@
1
+ import { isDate } from 'jet-validators';
2
+ import { transform } from 'jet-validators/utils';
3
+
4
+ /******************************************************************************
5
+ Functions
6
+ ******************************************************************************/
7
+
8
+ /**
9
+ * Convert to date object then check is a validate date.
10
+ */
11
+ export const transformIsDate = transform(
12
+ arg => new Date(arg as string),
13
+ arg => isDate(arg),
14
+ );
@@ -0,0 +1,27 @@
1
+ import logger from 'jet-logger';
2
+
3
+ import ENV from '@src/common/constants/ENV';
4
+ import server from './server';
5
+
6
+
7
+ /******************************************************************************
8
+ Constants
9
+ ******************************************************************************/
10
+
11
+ const SERVER_START_MSG = (
12
+ 'Express server started on port: ' + ENV.Port.toString()
13
+ );
14
+
15
+
16
+ /******************************************************************************
17
+ Run
18
+ ******************************************************************************/
19
+
20
+ // Start the server
21
+ server.listen(ENV.Port, err => {
22
+ if (!!err) {
23
+ logger.err(err.message);
24
+ } else {
25
+ logger.info(SERVER_START_MSG);
26
+ }
27
+ });