gg-express 1.0.8 → 1.0.9
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/dist/GGExpress.d.ts +3 -2
- package/dist/GGExpress.js +3 -0
- package/package.json +1 -1
- package/src/GGExpress.ts +5 -2
package/dist/GGExpress.d.ts
CHANGED
|
@@ -56,7 +56,8 @@ export default class GGExpress {
|
|
|
56
56
|
requireParams: M;
|
|
57
57
|
responseStructure: R;
|
|
58
58
|
}, ...middlewares: Array<(req: MyRequest<M["dataType"], T, K>, res: MyResponse<R["dataType"], RS, KR>, next: NextFunction) => any>): Express.Express;
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
generateAPIFiles(): void;
|
|
60
|
+
private generateStaticRouteFile;
|
|
61
|
+
private generateGGApi;
|
|
61
62
|
}
|
|
62
63
|
export {};
|
package/dist/GGExpress.js
CHANGED
|
@@ -34,6 +34,9 @@ class GGExpress {
|
|
|
34
34
|
delete(url, options, ...middlewares) {
|
|
35
35
|
return this.rootMethod("delete", url, options, ...middlewares);
|
|
36
36
|
}
|
|
37
|
+
generateAPIFiles() {
|
|
38
|
+
this.generateStaticRouteFile();
|
|
39
|
+
}
|
|
37
40
|
generateStaticRouteFile() {
|
|
38
41
|
const genRequireParamCode = (data) => {
|
|
39
42
|
let result;
|
package/package.json
CHANGED
package/src/GGExpress.ts
CHANGED
|
@@ -215,7 +215,10 @@ export default class GGExpress {
|
|
|
215
215
|
) {
|
|
216
216
|
return this.rootMethod("delete", url, options, ...middlewares)
|
|
217
217
|
}
|
|
218
|
-
|
|
218
|
+
public generateAPIFiles() {
|
|
219
|
+
this.generateStaticRouteFile()
|
|
220
|
+
}
|
|
221
|
+
private generateStaticRouteFile() {
|
|
219
222
|
const genRequireParamCode = (data: requireParamsStructure) => {
|
|
220
223
|
let result: string
|
|
221
224
|
const resultArray = Object.entries(data["structure"]).map(
|
|
@@ -301,7 +304,7 @@ export default class GGExpress {
|
|
|
301
304
|
// fs.writeFileSync(serverFilePath, content)
|
|
302
305
|
// fs.writeFileSync(myAppFilePath, content)
|
|
303
306
|
}
|
|
304
|
-
generateGGApi(filePathWithFileName : string) {
|
|
307
|
+
private generateGGApi(filePathWithFileName : string) {
|
|
305
308
|
let code = `
|
|
306
309
|
import { staticRouteInterface } from "./staticRouteInterface"
|
|
307
310
|
import axios from "axios"
|