typescript-express-starter 7.0.0 → 8.0.0
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.kr.md +8 -4
- package/README.md +8 -4
- package/lib/typegoose/.dockerignore +18 -0
- package/lib/typegoose/.editorconfig +9 -0
- package/lib/typegoose/.env.development.local +18 -0
- package/lib/typegoose/.env.production.local +18 -0
- package/lib/typegoose/.env.test.local +18 -0
- package/lib/typegoose/.eslintignore +1 -0
- package/lib/typegoose/.eslintrc +18 -0
- package/lib/typegoose/.huskyrc +5 -0
- package/lib/typegoose/.lintstagedrc.json +5 -0
- package/lib/typegoose/.prettierrc +8 -0
- package/lib/typegoose/.swcrc +40 -0
- package/lib/typegoose/.vscode/launch.json +35 -0
- package/lib/typegoose/.vscode/settings.json +6 -0
- package/lib/typegoose/Dockerfile +24 -0
- package/lib/typegoose/Makefile +6 -0
- package/lib/typegoose/docker-compose.yml +46 -0
- package/lib/typegoose/ecosystem.config.js +57 -0
- package/lib/typegoose/jest.config.js +12 -0
- package/lib/typegoose/nginx.conf +40 -0
- package/lib/typegoose/nodemon.json +12 -0
- package/lib/typegoose/package.json +80 -0
- package/lib/typegoose/src/app.ts +93 -0
- package/lib/typegoose/src/config/index.ts +5 -0
- package/lib/typegoose/src/controllers/auth.controller.ts +46 -0
- package/lib/typegoose/src/controllers/index.controller.ts +13 -0
- package/lib/typegoose/src/controllers/users.controller.ts +65 -0
- package/lib/typegoose/src/databases/index.ts +3 -0
- package/lib/typegoose/src/dtos/users.dto.ts +9 -0
- package/lib/typegoose/src/exceptions/HttpException.ts +10 -0
- package/lib/typegoose/src/http/auth.http +32 -0
- package/lib/typegoose/src/http/users.http +34 -0
- package/lib/typegoose/src/interfaces/auth.interface.ts +15 -0
- package/lib/typegoose/src/interfaces/routes.interface.ts +6 -0
- package/lib/typegoose/src/interfaces/users.interface.ts +5 -0
- package/lib/typegoose/src/middlewares/auth.middleware.ts +32 -0
- package/lib/typegoose/src/middlewares/error.middleware.ts +17 -0
- package/lib/typegoose/src/middlewares/validation.middleware.ts +25 -0
- package/lib/typegoose/src/models/users.model.ts +18 -0
- package/lib/typegoose/src/routes/auth.route.ts +24 -0
- package/lib/typegoose/src/routes/index.route.ts +19 -0
- package/lib/typegoose/src/routes/users.route.ts +25 -0
- package/lib/typegoose/src/server.ts +11 -0
- package/lib/typegoose/src/services/auth.service.ts +61 -0
- package/lib/typegoose/src/services/users.service.ts +64 -0
- package/lib/typegoose/src/tests/auth.test.ts +83 -0
- package/lib/typegoose/src/tests/index.test.ts +18 -0
- package/lib/typegoose/src/tests/users.test.ts +133 -0
- package/lib/typegoose/src/utils/logger.ts +65 -0
- package/lib/typegoose/src/utils/util.ts +19 -0
- package/lib/typegoose/src/utils/validateEnv.ts +10 -0
- package/lib/typegoose/swagger.yaml +122 -0
- package/lib/typegoose/tsconfig.json +40 -0
- package/package.json +2 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import bcrypt from 'bcrypt';
|
|
2
|
+
import mongoose from 'mongoose';
|
|
3
|
+
import request from 'supertest';
|
|
4
|
+
import App from '@/app';
|
|
5
|
+
import { CreateUserDto } from '@dtos/users.dto';
|
|
6
|
+
import AuthRoute from '@routes/auth.route';
|
|
7
|
+
|
|
8
|
+
afterAll(async () => {
|
|
9
|
+
await new Promise<void>(resolve => setTimeout(() => resolve(), 500));
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
describe('Testing Auth', () => {
|
|
13
|
+
describe('[POST] /signup', () => {
|
|
14
|
+
it('response should have the Create userData', async () => {
|
|
15
|
+
const userData: CreateUserDto = {
|
|
16
|
+
email: 'test@email.com',
|
|
17
|
+
password: 'q1w2e3r4!',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const authRoute = new AuthRoute();
|
|
21
|
+
const users = authRoute.authController.authService.users;
|
|
22
|
+
|
|
23
|
+
users.findOne = jest.fn().mockReturnValue(null);
|
|
24
|
+
users.create = jest.fn().mockReturnValue({
|
|
25
|
+
_id: '60706478aad6c9ad19a31c84',
|
|
26
|
+
email: userData.email,
|
|
27
|
+
password: await bcrypt.hash(userData.password, 10),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
(mongoose as any).connect = jest.fn();
|
|
31
|
+
const app = new App([authRoute]);
|
|
32
|
+
return request(app.getServer()).post(`${authRoute.path}signup`).send(userData);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe('[POST] /login', () => {
|
|
37
|
+
it('response should have the Set-Cookie header with the Authorization token', async () => {
|
|
38
|
+
const userData: CreateUserDto = {
|
|
39
|
+
email: 'test@email.com',
|
|
40
|
+
password: 'q1w2e3r4!',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const authRoute = new AuthRoute();
|
|
44
|
+
const users = authRoute.authController.authService.users;
|
|
45
|
+
|
|
46
|
+
users.findOne = jest.fn().mockReturnValue({
|
|
47
|
+
_id: '60706478aad6c9ad19a31c84',
|
|
48
|
+
email: userData.email,
|
|
49
|
+
password: await bcrypt.hash(userData.password, 10),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
(mongoose as any).connect = jest.fn();
|
|
53
|
+
const app = new App([authRoute]);
|
|
54
|
+
return request(app.getServer())
|
|
55
|
+
.post(`${authRoute.path}login`)
|
|
56
|
+
.send(userData)
|
|
57
|
+
.expect('Set-Cookie', /^Authorization=.+/);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// describe('[POST] /logout', () => {
|
|
62
|
+
// it('logout Set-Cookie Authorization=; Max-age=0', async () => {
|
|
63
|
+
// const userData: User = {
|
|
64
|
+
// _id: '60706478aad6c9ad19a31c84',
|
|
65
|
+
// email: 'test@email.com',
|
|
66
|
+
// password: await bcrypt.hash('q1w2e3r4!', 10),
|
|
67
|
+
// };
|
|
68
|
+
|
|
69
|
+
// const authRoute = new AuthRoute();
|
|
70
|
+
// const users = authRoute.authController.authService.users;
|
|
71
|
+
|
|
72
|
+
// users.findOne = jest.fn().mockReturnValue(userData);
|
|
73
|
+
|
|
74
|
+
// (mongoose as any).connect = jest.fn();
|
|
75
|
+
// const app = new App([authRoute]);
|
|
76
|
+
// return request(app.getServer())
|
|
77
|
+
// .post(`${authRoute.path}logout`)
|
|
78
|
+
// .send(userData)
|
|
79
|
+
// .set('Set-Cookie', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ')
|
|
80
|
+
// .expect('Set-Cookie', /^Authorization=\; Max-age=0/);
|
|
81
|
+
// });
|
|
82
|
+
// });
|
|
83
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import request from 'supertest';
|
|
2
|
+
import App from '@/app';
|
|
3
|
+
import IndexRoute from '@routes/index.route';
|
|
4
|
+
|
|
5
|
+
afterAll(async () => {
|
|
6
|
+
await new Promise<void>(resolve => setTimeout(() => resolve(), 500));
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
describe('Testing Index', () => {
|
|
10
|
+
describe('[GET] /', () => {
|
|
11
|
+
it('response statusCode 200', () => {
|
|
12
|
+
const indexRoute = new IndexRoute();
|
|
13
|
+
const app = new App([indexRoute]);
|
|
14
|
+
|
|
15
|
+
return request(app.getServer()).get(`${indexRoute.path}`).expect(200);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import bcrypt from 'bcrypt';
|
|
2
|
+
import mongoose from 'mongoose';
|
|
3
|
+
import request from 'supertest';
|
|
4
|
+
import App from '@/app';
|
|
5
|
+
import { CreateUserDto } from '@dtos/users.dto';
|
|
6
|
+
import UsersRoute from '@routes/users.route';
|
|
7
|
+
|
|
8
|
+
afterAll(async () => {
|
|
9
|
+
await new Promise<void>(resolve => setTimeout(() => resolve(), 500));
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
describe('Testing Users', () => {
|
|
13
|
+
describe('[GET] /users', () => {
|
|
14
|
+
it('response fineAll Users', async () => {
|
|
15
|
+
const usersRoute = new UsersRoute();
|
|
16
|
+
const users = usersRoute.usersController.userService.users;
|
|
17
|
+
|
|
18
|
+
users.find = jest.fn().mockReturnValue([
|
|
19
|
+
{
|
|
20
|
+
_id: 'qpwoeiruty',
|
|
21
|
+
email: 'a@email.com',
|
|
22
|
+
password: await bcrypt.hash('q1w2e3r4!', 10),
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
_id: 'alskdjfhg',
|
|
26
|
+
email: 'b@email.com',
|
|
27
|
+
password: await bcrypt.hash('a1s2d3f4!', 10),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
_id: 'zmxncbv',
|
|
31
|
+
email: 'c@email.com',
|
|
32
|
+
password: await bcrypt.hash('z1x2c3v4!', 10),
|
|
33
|
+
},
|
|
34
|
+
]);
|
|
35
|
+
|
|
36
|
+
(mongoose as any).connect = jest.fn();
|
|
37
|
+
const app = new App([usersRoute]);
|
|
38
|
+
return request(app.getServer()).get(`${usersRoute.path}`).expect(200);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
describe('[GET] /users/:id', () => {
|
|
43
|
+
it('response findOne User', async () => {
|
|
44
|
+
const userId = 'qpwoeiruty';
|
|
45
|
+
|
|
46
|
+
const usersRoute = new UsersRoute();
|
|
47
|
+
const users = usersRoute.usersController.userService.users;
|
|
48
|
+
|
|
49
|
+
users.findOne = jest.fn().mockReturnValue({
|
|
50
|
+
_id: 'qpwoeiruty',
|
|
51
|
+
email: 'a@email.com',
|
|
52
|
+
password: await bcrypt.hash('q1w2e3r4!', 10),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
(mongoose as any).connect = jest.fn();
|
|
56
|
+
const app = new App([usersRoute]);
|
|
57
|
+
return request(app.getServer()).get(`${usersRoute.path}/${userId}`).expect(200);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
describe('[POST] /users', () => {
|
|
62
|
+
it('response Create User', async () => {
|
|
63
|
+
const userData: CreateUserDto = {
|
|
64
|
+
email: 'test@email.com',
|
|
65
|
+
password: 'q1w2e3r4',
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const usersRoute = new UsersRoute();
|
|
69
|
+
const users = usersRoute.usersController.userService.users;
|
|
70
|
+
|
|
71
|
+
users.findOne = jest.fn().mockReturnValue(null);
|
|
72
|
+
users.create = jest.fn().mockReturnValue({
|
|
73
|
+
_id: '60706478aad6c9ad19a31c84',
|
|
74
|
+
email: userData.email,
|
|
75
|
+
password: await bcrypt.hash(userData.password, 10),
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
(mongoose as any).connect = jest.fn();
|
|
79
|
+
const app = new App([usersRoute]);
|
|
80
|
+
return request(app.getServer()).post(`${usersRoute.path}`).send(userData).expect(201);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
describe('[PUT] /users/:id', () => {
|
|
85
|
+
it('response Update User', async () => {
|
|
86
|
+
const userId = '60706478aad6c9ad19a31c84';
|
|
87
|
+
const userData: CreateUserDto = {
|
|
88
|
+
email: 'test@email.com',
|
|
89
|
+
password: 'q1w2e3r4',
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const usersRoute = new UsersRoute();
|
|
93
|
+
const users = usersRoute.usersController.userService.users;
|
|
94
|
+
|
|
95
|
+
if (userData.email) {
|
|
96
|
+
users.findOne = jest.fn().mockReturnValue({
|
|
97
|
+
_id: userId,
|
|
98
|
+
email: userData.email,
|
|
99
|
+
password: await bcrypt.hash(userData.password, 10),
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
users.findByIdAndUpdate = jest.fn().mockReturnValue({
|
|
104
|
+
_id: userId,
|
|
105
|
+
email: userData.email,
|
|
106
|
+
password: await bcrypt.hash(userData.password, 10),
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
(mongoose as any).connect = jest.fn();
|
|
110
|
+
const app = new App([usersRoute]);
|
|
111
|
+
return request(app.getServer()).put(`${usersRoute.path}/${userId}`).send(userData);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
describe('[DELETE] /users/:id', () => {
|
|
116
|
+
it('response Delete User', async () => {
|
|
117
|
+
const userId = '60706478aad6c9ad19a31c84';
|
|
118
|
+
|
|
119
|
+
const usersRoute = new UsersRoute();
|
|
120
|
+
const users = usersRoute.usersController.userService.users;
|
|
121
|
+
|
|
122
|
+
users.findByIdAndDelete = jest.fn().mockReturnValue({
|
|
123
|
+
_id: '60706478aad6c9ad19a31c84',
|
|
124
|
+
email: 'test@email.com',
|
|
125
|
+
password: await bcrypt.hash('q1w2e3r4!', 10),
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
(mongoose as any).connect = jest.fn();
|
|
129
|
+
const app = new App([usersRoute]);
|
|
130
|
+
return request(app.getServer()).delete(`${usersRoute.path}/${userId}`).expect(200);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { existsSync, mkdirSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import winston from 'winston';
|
|
4
|
+
import winstonDaily from 'winston-daily-rotate-file';
|
|
5
|
+
import { LOG_DIR } from '@config';
|
|
6
|
+
|
|
7
|
+
// logs dir
|
|
8
|
+
const logDir: string = join(__dirname, LOG_DIR);
|
|
9
|
+
|
|
10
|
+
if (!existsSync(logDir)) {
|
|
11
|
+
mkdirSync(logDir);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Define log format
|
|
15
|
+
const logFormat = winston.format.printf(({ timestamp, level, message }) => `${timestamp} ${level}: ${message}`);
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
* Log Level
|
|
19
|
+
* error: 0, warn: 1, info: 2, http: 3, verbose: 4, debug: 5, silly: 6
|
|
20
|
+
*/
|
|
21
|
+
const logger = winston.createLogger({
|
|
22
|
+
format: winston.format.combine(
|
|
23
|
+
winston.format.timestamp({
|
|
24
|
+
format: 'YYYY-MM-DD HH:mm:ss',
|
|
25
|
+
}),
|
|
26
|
+
logFormat,
|
|
27
|
+
),
|
|
28
|
+
transports: [
|
|
29
|
+
// debug log setting
|
|
30
|
+
new winstonDaily({
|
|
31
|
+
level: 'debug',
|
|
32
|
+
datePattern: 'YYYY-MM-DD',
|
|
33
|
+
dirname: logDir + '/debug', // log file /logs/debug/*.log in save
|
|
34
|
+
filename: `%DATE%.log`,
|
|
35
|
+
maxFiles: 30, // 30 Days saved
|
|
36
|
+
json: false,
|
|
37
|
+
zippedArchive: true,
|
|
38
|
+
}),
|
|
39
|
+
// error log setting
|
|
40
|
+
new winstonDaily({
|
|
41
|
+
level: 'error',
|
|
42
|
+
datePattern: 'YYYY-MM-DD',
|
|
43
|
+
dirname: logDir + '/error', // log file /logs/error/*.log in save
|
|
44
|
+
filename: `%DATE%.log`,
|
|
45
|
+
maxFiles: 30, // 30 Days saved
|
|
46
|
+
handleExceptions: true,
|
|
47
|
+
json: false,
|
|
48
|
+
zippedArchive: true,
|
|
49
|
+
}),
|
|
50
|
+
],
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
logger.add(
|
|
54
|
+
new winston.transports.Console({
|
|
55
|
+
format: winston.format.combine(winston.format.splat(), winston.format.colorize()),
|
|
56
|
+
}),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const stream = {
|
|
60
|
+
write: (message: string) => {
|
|
61
|
+
logger.info(message.substring(0, message.lastIndexOf('\n')));
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export { logger, stream };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @method isEmpty
|
|
3
|
+
* @param {String | Number | Object} value
|
|
4
|
+
* @returns {Boolean} true & false
|
|
5
|
+
* @description this value is Empty Check
|
|
6
|
+
*/
|
|
7
|
+
export const isEmpty = (value: string | number | object): boolean => {
|
|
8
|
+
if (value === null) {
|
|
9
|
+
return true;
|
|
10
|
+
} else if (typeof value !== 'number' && value === '') {
|
|
11
|
+
return true;
|
|
12
|
+
} else if (typeof value === 'undefined' || value === undefined) {
|
|
13
|
+
return true;
|
|
14
|
+
} else if (value !== null && typeof value === 'object' && !Object.keys(value).length) {
|
|
15
|
+
return true;
|
|
16
|
+
} else {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
tags:
|
|
2
|
+
- name: users
|
|
3
|
+
description: users API
|
|
4
|
+
|
|
5
|
+
paths:
|
|
6
|
+
# [GET] users
|
|
7
|
+
/users:
|
|
8
|
+
get:
|
|
9
|
+
tags:
|
|
10
|
+
- users
|
|
11
|
+
summary: Find All Users
|
|
12
|
+
responses:
|
|
13
|
+
200:
|
|
14
|
+
description: 'OK'
|
|
15
|
+
500:
|
|
16
|
+
description: 'Server Error'
|
|
17
|
+
|
|
18
|
+
# [POST] users
|
|
19
|
+
post:
|
|
20
|
+
tags:
|
|
21
|
+
- users
|
|
22
|
+
summary: Add User
|
|
23
|
+
parameters:
|
|
24
|
+
- name: body
|
|
25
|
+
in: body
|
|
26
|
+
description: user Data
|
|
27
|
+
required: true
|
|
28
|
+
schema:
|
|
29
|
+
$ref: '#/definitions/users'
|
|
30
|
+
responses:
|
|
31
|
+
201:
|
|
32
|
+
description: 'Created'
|
|
33
|
+
400:
|
|
34
|
+
description: 'Bad Request'
|
|
35
|
+
409:
|
|
36
|
+
description: 'Conflict'
|
|
37
|
+
500:
|
|
38
|
+
description: 'Server Error'
|
|
39
|
+
|
|
40
|
+
# [GET] users/id
|
|
41
|
+
/users/{id}:
|
|
42
|
+
get:
|
|
43
|
+
tags:
|
|
44
|
+
- users
|
|
45
|
+
summary: Find User By Id
|
|
46
|
+
parameters:
|
|
47
|
+
- name: id
|
|
48
|
+
in: path
|
|
49
|
+
description: User Id
|
|
50
|
+
required: true
|
|
51
|
+
responses:
|
|
52
|
+
200:
|
|
53
|
+
description: 'OK'
|
|
54
|
+
409:
|
|
55
|
+
description: 'Conflict'
|
|
56
|
+
500:
|
|
57
|
+
description: 'Server Error'
|
|
58
|
+
|
|
59
|
+
# [PUT] users/id
|
|
60
|
+
put:
|
|
61
|
+
tags:
|
|
62
|
+
- users
|
|
63
|
+
summary: Update User By Id
|
|
64
|
+
parameters:
|
|
65
|
+
- name: id
|
|
66
|
+
in: path
|
|
67
|
+
description: user Id
|
|
68
|
+
required: true
|
|
69
|
+
- name: body
|
|
70
|
+
in: body
|
|
71
|
+
description: user Data
|
|
72
|
+
required: true
|
|
73
|
+
schema:
|
|
74
|
+
$ref: '#/definitions/users'
|
|
75
|
+
responses:
|
|
76
|
+
200:
|
|
77
|
+
description: 'OK'
|
|
78
|
+
400:
|
|
79
|
+
description: 'Bad Request'
|
|
80
|
+
409:
|
|
81
|
+
description: 'Conflict'
|
|
82
|
+
500:
|
|
83
|
+
description: 'Server Error'
|
|
84
|
+
|
|
85
|
+
# [DELETE] users/id
|
|
86
|
+
delete:
|
|
87
|
+
tags:
|
|
88
|
+
- users
|
|
89
|
+
summary: Delete User By Id
|
|
90
|
+
parameters:
|
|
91
|
+
- name: id
|
|
92
|
+
in: path
|
|
93
|
+
description: user Id
|
|
94
|
+
required: true
|
|
95
|
+
responses:
|
|
96
|
+
200:
|
|
97
|
+
description: 'OK'
|
|
98
|
+
409:
|
|
99
|
+
description: 'Conflict'
|
|
100
|
+
500:
|
|
101
|
+
description: 'Server Error'
|
|
102
|
+
|
|
103
|
+
# definitions
|
|
104
|
+
definitions:
|
|
105
|
+
users:
|
|
106
|
+
type: object
|
|
107
|
+
required:
|
|
108
|
+
- email
|
|
109
|
+
- password
|
|
110
|
+
properties:
|
|
111
|
+
id:
|
|
112
|
+
description: user Id
|
|
113
|
+
email:
|
|
114
|
+
type: string
|
|
115
|
+
description: user Email
|
|
116
|
+
password:
|
|
117
|
+
type: string
|
|
118
|
+
description: user Password
|
|
119
|
+
|
|
120
|
+
schemes:
|
|
121
|
+
- https
|
|
122
|
+
- http
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compileOnSave": false,
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "es2017",
|
|
5
|
+
"lib": ["es2017", "esnext.asynciterable"],
|
|
6
|
+
"typeRoots": ["node_modules/@types"],
|
|
7
|
+
"allowSyntheticDefaultImports": true,
|
|
8
|
+
"experimentalDecorators": true,
|
|
9
|
+
"emitDecoratorMetadata": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"module": "commonjs",
|
|
13
|
+
"pretty": true,
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"declaration": true,
|
|
16
|
+
"outDir": "dist",
|
|
17
|
+
"allowJs": true,
|
|
18
|
+
"noEmit": false,
|
|
19
|
+
"esModuleInterop": true,
|
|
20
|
+
"resolveJsonModule": true,
|
|
21
|
+
"importHelpers": true,
|
|
22
|
+
"baseUrl": "src",
|
|
23
|
+
"paths": {
|
|
24
|
+
"@/*": ["*"],
|
|
25
|
+
"@config": ["config"],
|
|
26
|
+
"@controllers/*": ["controllers/*"],
|
|
27
|
+
"@databases": ["databases"],
|
|
28
|
+
"@dtos/*": ["dtos/*"],
|
|
29
|
+
"@exceptions/*": ["exceptions/*"],
|
|
30
|
+
"@interfaces/*": ["interfaces/*"],
|
|
31
|
+
"@middlewares/*": ["middlewares/*"],
|
|
32
|
+
"@models/*": ["models/*"],
|
|
33
|
+
"@routes/*": ["routes/*"],
|
|
34
|
+
"@services/*": ["services/*"],
|
|
35
|
+
"@utils/*": ["utils/*"]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"include": ["src/**/*.ts", "src/**/*.json", ".env"],
|
|
39
|
+
"exclude": ["node_modules", "src/http", "src/logs", "src/tests"]
|
|
40
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typescript-express-starter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Quick and Easy TypeScript Express Starter",
|
|
5
5
|
"author": "AGUMON <ljlm0402@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"routing-controllers-openapi",
|
|
12
12
|
"sequelize",
|
|
13
13
|
"mongoose",
|
|
14
|
+
"typegoose",
|
|
14
15
|
"typeorm",
|
|
15
16
|
"knex",
|
|
16
17
|
"prisma",
|