very-express 0.4.11 → 0.4.12
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/.eslintrc.json +37 -37
- package/.gitattributes +2 -2
- package/.github/workflows/npm-publish.yml +38 -0
- package/LICENSE +21 -21
- package/README.md +61 -60
- package/docs/developmentNote.md +22 -22
- package/docs/roadMap/RoadMap.md +30 -30
- package/docs/roadMap/v0-5-0.md +19 -19
- package/docs/roadMap/v0-6-0.md +6 -6
- package/docs/roadMap/v0-7-0.md +3 -3
- package/docs/vexJsonSchema.md +54 -54
- package/package.json +59 -59
- package/scripts/build.js +13 -13
- package/scripts/copyTsTemplates.js +24 -24
- package/tsconfig.json +121 -121
- package/vex.config.json +1 -1
- package/dist/index.js +0 -1441
- package/dist/templates/_controller/_ControllerFactory.ts +0 -7
- package/dist/templates/_controllers/_ControllerFactory.ts +0 -9
- package/dist/templates/_plugins/PassportGoogle.ts +0 -84
- package/dist/templates/_plugins/oauthVerify.ts +0 -39
- package/dist/templates/_roles/_RoleFactory.ts +0 -22
- package/dist/templates/_services/VexDbConnector.ts +0 -70
- package/dist/templates/_types/responseMsg.ts +0 -20
- package/dist/templates/_utils/common.ts +0 -53
- package/dist/templates/_utils/index.ts +0 -13
- package/dist/templates/_utils/logger.ts +0 -55
- package/dist/templates/_utils/response.ts +0 -27
- package/dist/templates/_utils/validator.ts +0 -7
- package/dist/templates/jsonSchema/User.json +0 -56
- package/dist/templates/root/.env +0 -5
- package/dist/templates/root/README.md +0 -33
- package/dist/templates/root/package.json +0 -40
- package/dist/templates/root/tsconfig.json +0 -22
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// {{headerComment}}
|
|
2
|
-
|
|
3
|
-
import { Router } from "express";
|
|
4
|
-
import passport, { PassportStatic, Profile } from "passport";
|
|
5
|
-
import { AuthenticateOptionsGoogle, Strategy as GoogleStrategy, StrategyOptions, VerifyCallback } from "passport-google-oauth20";
|
|
6
|
-
import { UserModel } from "./../_models/UserModel.gen";
|
|
7
|
-
|
|
8
|
-
export type { Profile };
|
|
9
|
-
|
|
10
|
-
export interface passportGoogleConfig {
|
|
11
|
-
strategyConfig: {
|
|
12
|
-
options?: StrategyOptions,
|
|
13
|
-
verify: (accessToken: string, refreshToken: string, profile: Profile, done: VerifyCallback) => void
|
|
14
|
-
},
|
|
15
|
-
authenticateOptionsGoogle?: AuthenticateOptionsGoogle,
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/** Provides a router and passport instance for Google OAuth */
|
|
19
|
-
export default class PassportGoogle {
|
|
20
|
-
|
|
21
|
-
private config: passportGoogleConfig;
|
|
22
|
-
public router: Router = Router();
|
|
23
|
-
public passport: PassportStatic = passport;
|
|
24
|
-
|
|
25
|
-
constructor(config: passportGoogleConfig ) {
|
|
26
|
-
|
|
27
|
-
this.config = config;
|
|
28
|
-
|
|
29
|
-
this.passport.use(new GoogleStrategy(
|
|
30
|
-
this.config.strategyConfig.options || {
|
|
31
|
-
clientID: process.env.OAUTH_GOOGLE_CLIENTID || "",
|
|
32
|
-
clientSecret: process.env.OAUTH_GOOGLE_CLIENTSECRET || "",
|
|
33
|
-
callbackURL: `${process.env.APP_HOST}/auth/google/callback`,
|
|
34
|
-
},
|
|
35
|
-
this.config.strategyConfig.verify
|
|
36
|
-
));
|
|
37
|
-
|
|
38
|
-
// redirect to google login
|
|
39
|
-
this.router.get("/auth/google",
|
|
40
|
-
this.passport.authenticate("google", this.config.authenticateOptionsGoogle || { scope: ["profile", "email"] })
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
// back from google login
|
|
44
|
-
this.router.get("/auth/google/callback",
|
|
45
|
-
this.passport.authenticate("google", { failureRedirect: "/login" }),
|
|
46
|
-
(req, res) => {
|
|
47
|
-
res.redirect("/profile");
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
public passportSerializeUser() {
|
|
53
|
-
this.passport.serializeUser(async (user, done) => {
|
|
54
|
-
// you can decide what data to store in the session here.
|
|
55
|
-
// this data will be used in `deserializeUser` to retrieve the full user object.
|
|
56
|
-
// ussually just user's id.
|
|
57
|
-
|
|
58
|
-
// store role in session for access control
|
|
59
|
-
const DbUser = await UserModel.findById(user);
|
|
60
|
-
if (DbUser) {
|
|
61
|
-
done(null, DbUser);
|
|
62
|
-
} else {
|
|
63
|
-
done(new Error("User not found"));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
done(null, user);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
public async passportDeserializeUser() {
|
|
71
|
-
this.passport.deserializeUser(async (id, done) => {
|
|
72
|
-
|
|
73
|
-
const user = await UserModel.findById(id);
|
|
74
|
-
if (user) {
|
|
75
|
-
done(null, user);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
done(new Error("User not found"));
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// {{headerComment}}
|
|
2
|
-
|
|
3
|
-
import { Profile } from "passport";
|
|
4
|
-
import { UserModel } from "./../_models/UserModel.gen";
|
|
5
|
-
|
|
6
|
-
interface IProfile extends Profile {
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export default async function oauthVerify(accessToken: string, refreshToken: string, profile: IProfile, done: (error: any, user?: any) => void) : Promise<void> {
|
|
11
|
-
try {
|
|
12
|
-
|
|
13
|
-
// find or create user
|
|
14
|
-
const existingUser = await UserModel.findOne({ email: profile.emails?.[0].value });
|
|
15
|
-
|
|
16
|
-
if( existingUser ){
|
|
17
|
-
// log.info('OAuthVerify ExistingUser');
|
|
18
|
-
return done(null, existingUser);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
// log.info('OAuthVerify NewUser');
|
|
22
|
-
const newUser = new UserModel({
|
|
23
|
-
authProvider: profile.provider,
|
|
24
|
-
email: profile.emails?.[0].value || "",
|
|
25
|
-
authId: profile.id,
|
|
26
|
-
name: profile.displayName,
|
|
27
|
-
familyName: profile.name?.familyName,
|
|
28
|
-
givenName: profile.name?.givenName,
|
|
29
|
-
isActive: true,
|
|
30
|
-
locale: profile._json?.locale,
|
|
31
|
-
});
|
|
32
|
-
newUser.save();
|
|
33
|
-
return done(null, newUser);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
catch(err) {
|
|
37
|
-
return done(err);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export type accessAction = "create" | "read" | "update" | "delete" | "search";
|
|
2
|
-
export const accessActionArr: accessAction[] = ["create", "read", "update", "delete", "search"];
|
|
3
|
-
|
|
4
|
-
export interface accessControl< T = accessAction > {
|
|
5
|
-
[key:string]: T[]
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export class _RoleFactory<T = accessAction> {
|
|
9
|
-
private accessControl: accessControl<T> = {};
|
|
10
|
-
|
|
11
|
-
constructor(accessControl: accessControl<T>) {
|
|
12
|
-
this.accessControl = accessControl;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public checkAccess(document: string, access: string): boolean {
|
|
16
|
-
if (this.accessControl[document]) {
|
|
17
|
-
return this.accessControl[document].includes(access as T);
|
|
18
|
-
}
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// {{headerComment}}
|
|
2
|
-
|
|
3
|
-
import mongoose from "mongoose";
|
|
4
|
-
import { Request, Response, NextFunction } from "express";
|
|
5
|
-
import vex from "./../_utils/index.gen";
|
|
6
|
-
|
|
7
|
-
export default class VexDbConnector {
|
|
8
|
-
private mongoUrl: string;
|
|
9
|
-
private sqlUrl: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
constructor(options:{
|
|
13
|
-
mongoUrl?: string;
|
|
14
|
-
sqlUrl?: string;
|
|
15
|
-
}){
|
|
16
|
-
this.mongoUrl = options.mongoUrl || "";
|
|
17
|
-
this.sqlUrl = options.sqlUrl || "";
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
connectMongo() : mongoose.Connection | void {
|
|
21
|
-
if ( !this.mongoUrl ){
|
|
22
|
-
vex.log.error("VexDbConnector : MongoUrl is not invalid");
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* @param retryTime time in second
|
|
27
|
-
*/
|
|
28
|
-
const connectWithRetry = (retryTime: number = 10) : Promise<void | typeof mongoose> => {
|
|
29
|
-
// vex.log.infoMongo("Connection with retry");
|
|
30
|
-
return mongoose.connect(this.mongoUrl, {
|
|
31
|
-
autoCreate: true,
|
|
32
|
-
connectTimeoutMS: 5000,
|
|
33
|
-
})
|
|
34
|
-
.catch((err) => {
|
|
35
|
-
vex.log.errorMongo(`Failed to Connect DB, Retrying in ${retryTime} seconds.`, err);
|
|
36
|
-
setTimeout(connectWithRetry, retryTime*1000);
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
connectWithRetry(10);
|
|
40
|
-
|
|
41
|
-
mongoose.connection.on("open", () => {
|
|
42
|
-
vex.log.infoMongo("MongoDB Connection open");
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
mongoose.connection.on("error", (err: any) => {
|
|
46
|
-
vex.log.errorMongo("MongoDB Connection error: ", err.message, err);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
return mongoose.connection;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
middleware(req: Request, res: Response, next: NextFunction) {
|
|
53
|
-
if (mongoose.connection.readyState !== 1) {
|
|
54
|
-
vex.response.send(res, 503, "Database Connection Down");
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
mongoose.connection.collection("accessLogs").insertOne({
|
|
58
|
-
timestamp: new Date().getTime(),
|
|
59
|
-
ipa: req.socket.remoteAddress || req.headers["x-forwarded-for"],
|
|
60
|
-
method: req.method,
|
|
61
|
-
url: req.url.split("?")[0],
|
|
62
|
-
headers: req.headers,
|
|
63
|
-
// body: req.body,
|
|
64
|
-
query: req.query,
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
next();
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export enum responseMsg {
|
|
2
|
-
permissionDeny = "Permission Denied",
|
|
3
|
-
ok = "OK",
|
|
4
|
-
notFound = "Not Found",
|
|
5
|
-
queryError = "Query Error",
|
|
6
|
-
validateError = "Validation Error",
|
|
7
|
-
unexpectedError = "Unexpected Error",
|
|
8
|
-
createFail = "Create Fail",
|
|
9
|
-
updateFail = "Update Fail",
|
|
10
|
-
deleteFail = "Delete Fail",
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface responseObject<T>{
|
|
14
|
-
ret_code : number,
|
|
15
|
-
ret_msg : string,
|
|
16
|
-
ret_time?: number,
|
|
17
|
-
result: T,
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default responseMsg;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// {{headerComment}}
|
|
2
|
-
|
|
3
|
-
import jsYaml from "js-yaml";
|
|
4
|
-
import fs from "fs";
|
|
5
|
-
|
|
6
|
-
export function loadYaml(yamlFilePath: string) {
|
|
7
|
-
try {
|
|
8
|
-
return jsYaml.load(fs.readFileSync(yamlFilePath, "utf8"));
|
|
9
|
-
} catch (e: any) {
|
|
10
|
-
console.log("\x1b[41m%s\x1b[0m", "[ERROR]", "Error Load OpenApi File :\n", e);
|
|
11
|
-
process.exit(0);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* build mongoose select object
|
|
17
|
-
* @param fieldsString json stringified array of string
|
|
18
|
-
* @error may throw an error if the fieldsString is not a valid JSON
|
|
19
|
-
*/
|
|
20
|
-
export function parseFieldsSelect(selectString: any) : { [key: string]: number } | undefined {
|
|
21
|
-
const ErrorArrStrMsg = "Invalid select string, only array of string accepted";
|
|
22
|
-
|
|
23
|
-
if (typeof selectString === "undefined" || selectString === "") {
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
else if (typeof selectString !== "string") {
|
|
27
|
-
throw new Error(ErrorArrStrMsg);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const fieldArr: string[] = JSON.parse(selectString);
|
|
31
|
-
|
|
32
|
-
if (!Array.isArray(fieldArr)) {
|
|
33
|
-
throw new Error(ErrorArrStrMsg);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
for (let i = 0; i < fieldArr.length; i++) {
|
|
37
|
-
if (typeof fieldArr[i] !== "string") {
|
|
38
|
-
throw new Error(ErrorArrStrMsg);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
// Convert the fieldArr to an object that can be used in the select method
|
|
42
|
-
const selectFields = fieldArr.reduce((obj: any, field: string) => {
|
|
43
|
-
obj[field] = 1;
|
|
44
|
-
return obj;
|
|
45
|
-
}, {} as Record<string, number>);
|
|
46
|
-
|
|
47
|
-
return selectFields;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export default {
|
|
51
|
-
loadYaml,
|
|
52
|
-
parseFieldsSelect
|
|
53
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import logger from "./logger.gen";
|
|
2
|
-
import response from "./response.gen";
|
|
3
|
-
import validator from "./validator.gen";
|
|
4
|
-
import { responseMsg } from "./../_types/responseMsg.gen";
|
|
5
|
-
import common from "./common.gen";
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
log : logger,
|
|
9
|
-
response,
|
|
10
|
-
validator,
|
|
11
|
-
responseMsg : responseMsg ,
|
|
12
|
-
common
|
|
13
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export function processing(msg: any, ...optionalParams: any[]): void {
|
|
2
|
-
console.log("\x1b[34m%s\x1b[0m", "[PROCESSING]", msg, optionalParams.length > 0 ? optionalParams : "");
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export function ok(msg: any, ...optionalParams: any[]): void {
|
|
6
|
-
console.log("\x1b[32m%s\x1b[0m", "[OK]", msg, optionalParams.length > 0 ? optionalParams : "");
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function info(msg: any, ...optionalParams: any[]): void {
|
|
10
|
-
console.log("\x1b[36m%s\x1b[0m", "[INFO]", msg, optionalParams.length > 0 ? optionalParams : "");
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function warn(msg: any, ...optionalParams: any[]): void {
|
|
14
|
-
console.log("\x1b[33m%s\x1b[0m", "[WARN]", msg, optionalParams.length > 0 ? optionalParams : "");
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function error(msg: any, ...optionalParams: any[]): never {
|
|
18
|
-
errorNoExit(msg, optionalParams);
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function errorNoExit(msg: any, ...optionalParams: any[]): void {
|
|
23
|
-
console.log("\x1b[41m%s\x1b[0m", "[ERROR]", msg, optionalParams.length > 0 ? optionalParams : "");
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// wrapper
|
|
27
|
-
export function infoMongo(msg: any, ...optionalParams: any[]): void {
|
|
28
|
-
info("[MONGO]", msg, optionalParams);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function errorMongo(msg: any, ...optionalParams: any[]): void {
|
|
32
|
-
errorNoExit("[MONGO]", msg, optionalParams);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function infoSql(msg: any, ...optionalParams: any[]): void {
|
|
36
|
-
info("[SQL]", msg, optionalParams);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function errorSql(msg: any, ...optionalParams: any[]): never {
|
|
40
|
-
error("[SQL]", msg, optionalParams);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export default {
|
|
44
|
-
process : processing,
|
|
45
|
-
ok,
|
|
46
|
-
info,
|
|
47
|
-
warn,
|
|
48
|
-
error,
|
|
49
|
-
errorNoExit,
|
|
50
|
-
|
|
51
|
-
infoMongo,
|
|
52
|
-
errorMongo,
|
|
53
|
-
infoSql,
|
|
54
|
-
errorSql,
|
|
55
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Response } from "express";
|
|
2
|
-
// import { responseObject } from "./../_types/responseMsg.gen";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @param res express response object
|
|
6
|
-
* @param code http status
|
|
7
|
-
* @param message response data message
|
|
8
|
-
* @param result response data result
|
|
9
|
-
* @returns express response object
|
|
10
|
-
*/
|
|
11
|
-
export function send<T = undefined>(
|
|
12
|
-
res: Response,
|
|
13
|
-
code: number = 200,
|
|
14
|
-
message: string = "OK",
|
|
15
|
-
result?: T,
|
|
16
|
-
): Response<any, Record<string, any>> {
|
|
17
|
-
return res.status(code).json({
|
|
18
|
-
ret_code: code,
|
|
19
|
-
ret_msg: message,
|
|
20
|
-
ret_time: new Date().getTime(),
|
|
21
|
-
result: result,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default {
|
|
26
|
-
send
|
|
27
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "object",
|
|
3
|
-
"x-documentConfig": {
|
|
4
|
-
"methods": [
|
|
5
|
-
"get",
|
|
6
|
-
"getList",
|
|
7
|
-
"post",
|
|
8
|
-
"patch"
|
|
9
|
-
]
|
|
10
|
-
},
|
|
11
|
-
"properties": {
|
|
12
|
-
"_id": {
|
|
13
|
-
"type": "string",
|
|
14
|
-
"index": true
|
|
15
|
-
},
|
|
16
|
-
"authProvider": {
|
|
17
|
-
"type": "string"
|
|
18
|
-
},
|
|
19
|
-
"authId": {
|
|
20
|
-
"type": "string",
|
|
21
|
-
"index": true
|
|
22
|
-
},
|
|
23
|
-
"email": {
|
|
24
|
-
"type": "string",
|
|
25
|
-
"format": "email",
|
|
26
|
-
"index": true,
|
|
27
|
-
"required": true
|
|
28
|
-
},
|
|
29
|
-
"name": {
|
|
30
|
-
"type": "string",
|
|
31
|
-
"maxLength": 64,
|
|
32
|
-
"required": true
|
|
33
|
-
},
|
|
34
|
-
"active": {
|
|
35
|
-
"type": "boolean",
|
|
36
|
-
"default": true,
|
|
37
|
-
"required": true
|
|
38
|
-
},
|
|
39
|
-
"locale": {
|
|
40
|
-
"type": "string",
|
|
41
|
-
"maxLength": 8
|
|
42
|
-
},
|
|
43
|
-
"roles":{
|
|
44
|
-
"type": "array",
|
|
45
|
-
"x-vexData": "role",
|
|
46
|
-
"items": {
|
|
47
|
-
"type": "string",
|
|
48
|
-
"default": "user",
|
|
49
|
-
"required": true,
|
|
50
|
-
"enum": [
|
|
51
|
-
"user"
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
package/dist/templates/root/.env
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# This app is generated by [VeryExpress](https://github.com/Justin26l/VeryExpress)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# Quick Start
|
|
5
|
-
|
|
6
|
-
1. check configuration file **vex.config.json** under your project root directory.
|
|
7
|
-
[vex.config.json](./vex.config.json)
|
|
8
|
-
|
|
9
|
-
2. generate the app with your vex.config settings.
|
|
10
|
-
*Note : every db schema changes require to regenerate app.
|
|
11
|
-
`vex`
|
|
12
|
-
3. you should saw a express typescript app being generated.
|
|
13
|
-
```
|
|
14
|
-
├── src/
|
|
15
|
-
│ └── ...
|
|
16
|
-
├── package.json
|
|
17
|
-
├── tsconfig.json
|
|
18
|
-
├── vex.config.json
|
|
19
|
-
├── .env
|
|
20
|
-
└── ...
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
4. start the generated express app.
|
|
24
|
-
```
|
|
25
|
-
npm i
|
|
26
|
-
npm build
|
|
27
|
-
npm run start
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
# Resource
|
|
31
|
-
- [Documents](https://github.com/Justin26l/VeryExpress/blob/main/README.md)
|
|
32
|
-
|
|
33
|
-
- [Discord](https://discord.gg/PZGMzDp7)
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"main": "index.js",
|
|
3
|
-
"scripts": {
|
|
4
|
-
"build": "tsc -p .",
|
|
5
|
-
"start": "node dist/server.js",
|
|
6
|
-
"dev": "nodemon --watch src --exec ts-node src/server.ts"
|
|
7
|
-
},
|
|
8
|
-
"dependencies": {
|
|
9
|
-
"dotenv": "^16.4.4",
|
|
10
|
-
"express": "^4.18.2",
|
|
11
|
-
"express-session": "^1.18.0",
|
|
12
|
-
"express-validator": "^7.0.1",
|
|
13
|
-
"helmet": "^7.1.0",
|
|
14
|
-
"js-yaml": "^4.1.0",
|
|
15
|
-
"mongo-ts-querystring": "^1.0.4",
|
|
16
|
-
"mongodb": "^5.6.0",
|
|
17
|
-
"mongoose": "^7.4.0",
|
|
18
|
-
"passport": "^0.7.0",
|
|
19
|
-
"passport-google-oauth20": "^2.0.0",
|
|
20
|
-
"swagger-ui-express": "^5.0.0"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@types/crypto-js": "^4.1.2",
|
|
24
|
-
"@types/dotenv": "^8.2.0",
|
|
25
|
-
"@types/express": "^4.17.17",
|
|
26
|
-
"@types/express-session": "^1.17.10",
|
|
27
|
-
"@types/express-validator": "^3.0.0",
|
|
28
|
-
"@types/js-yaml": "^4.0.9",
|
|
29
|
-
"@types/mongodb": "^4.0.7",
|
|
30
|
-
"@types/node": "^20.4.2",
|
|
31
|
-
"@types/passport": "^1.0.16",
|
|
32
|
-
"@types/passport-google-oauth20": "^2.0.14",
|
|
33
|
-
"@types/sequelize": "^4.28.15",
|
|
34
|
-
"@types/swagger-ui-express": "^4.1.6",
|
|
35
|
-
"@types/ws": "^8.5.5",
|
|
36
|
-
"nodemon": "^2.0.22",
|
|
37
|
-
"ts-node": "^10.9.1",
|
|
38
|
-
"typescript": "^5.1.6"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
-
|
|
5
|
-
/* Language and Environment */
|
|
6
|
-
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
7
|
-
|
|
8
|
-
/* Modules */
|
|
9
|
-
"module": "commonjs", /* Specify what module code is generated. */
|
|
10
|
-
|
|
11
|
-
/* Emit */
|
|
12
|
-
"outDir": "./dist", /* Specify an output folder for all emitted files. */
|
|
13
|
-
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
14
|
-
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
15
|
-
"allowArbitraryExtensions": true, /* Allow arbitrary file extensions. */
|
|
16
|
-
|
|
17
|
-
/* Type Checking */
|
|
18
|
-
"strict": true, /* Enable all strict type-checking options. */
|
|
19
|
-
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|