mdkcontroller 1.0.12 → 1.0.14
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/main.js +9 -8
- package/package.json +3 -3
package/main.js
CHANGED
|
@@ -9,6 +9,7 @@ import cookieParser from "cookie-parser";
|
|
|
9
9
|
import dbInstant from "./dk_modules/dkdb.js";
|
|
10
10
|
import userInstant from "./dk_modules/users.js";
|
|
11
11
|
import authInstant from "./dk_modules/authorization.js";
|
|
12
|
+
|
|
12
13
|
import {fileURLToPath} from "url";
|
|
13
14
|
import path from 'path';
|
|
14
15
|
// import {privateKey, encodeMini} from "./dk_modules/dkvar.js";
|
|
@@ -22,7 +23,6 @@ export default async function (appname, cfgHandler = {}) {
|
|
|
22
23
|
const server = createServer(app);
|
|
23
24
|
const db = await dbInstant(appname + "-Database.json");
|
|
24
25
|
const auth = authInstant(db);
|
|
25
|
-
|
|
26
26
|
const userRoutes = userInstant(Router(), db);
|
|
27
27
|
|
|
28
28
|
app.use(json());
|
|
@@ -66,12 +66,13 @@ export default async function (appname, cfgHandler = {}) {
|
|
|
66
66
|
server: app,
|
|
67
67
|
database: db,
|
|
68
68
|
authen: auth,
|
|
69
|
-
startListen:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
startListen:
|
|
70
|
+
function (kport = 8095) {
|
|
71
|
+
server.listen(kport, () => {
|
|
72
|
+
console.log(
|
|
73
|
+
`Server is listening on port ${kport}: http://localhost:${kport}`
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
76
77
|
}
|
|
77
78
|
}
|
package/package.json
CHANGED
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"socket.io": "^4.7.2"
|
|
11
11
|
},
|
|
12
12
|
"name": "mdkcontroller",
|
|
13
|
-
"version": "1.0.
|
|
13
|
+
"version": "1.0.14",
|
|
14
14
|
"keywords": [],
|
|
15
15
|
"author": "KHANHNBD <khanh272421@gmail.com>",
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"description": "Quick setup authentication and express",
|
|
18
18
|
"type": "module",
|
|
19
19
|
"exports": {
|
|
20
|
-
".": "./
|
|
20
|
+
".": "./index.js"
|
|
21
21
|
},
|
|
22
|
-
"types": "./
|
|
22
|
+
"types": "./index.js",
|
|
23
23
|
"files": [
|
|
24
24
|
"demoApp.js",
|
|
25
25
|
"main.js",
|