4bnode 3.5.3 → 4.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.md +138 -113
- package/add-api.js +288 -156
- package/add-crud.js +226 -0
- package/add-login.js +152 -319
- package/add-mongo-delete.js +67 -138
- package/add-mongo-insert.js +87 -204
- package/add-mongo-read.js +100 -216
- package/add-mongo-schema.js +431 -199
- package/add-mongo-update.js +89 -202
- package/add-mongo.js +125 -218
- package/add-serialport.js +53 -98
- package/add-socket.js +43 -66
- package/add-websocket.js +68 -140
- package/index.js +288 -155
- package/lib/env.js +18 -0
- package/lib/indexFile.js +87 -0
- package/lib/names.js +21 -0
- package/lib/project.js +122 -0
- package/lib/routeFile.js +56 -0
- package/lib/ui.js +161 -0
- package/package.json +9 -16
- package/skeleton/dev-api.js +2785 -0
- package/skeleton/index.js +10 -3
- package/skeleton/package.json +9 -5
- package/skeleton/public/fonts/NotoSans-Bold.woff2 +0 -0
- package/skeleton/public/fonts/NotoSans-Light.woff2 +0 -0
- package/skeleton/public/fonts/NotoSans-Medium.woff2 +0 -0
- package/skeleton/public/fonts/NotoSans-Regular.woff2 +0 -0
- package/skeleton/public/fonts/NotoSans-SemiBold.woff2 +0 -0
- package/skeleton/public/images/mongo.png +0 -0
- package/skeleton/public/images/mysql.png +0 -0
- package/skeleton/public/images/postgresql.png +0 -0
- package/skeleton/public/images/sqlite.png +0 -0
- package/skeleton/public/index.html +7562 -64
- package/README_4bnode.md +0 -197
- package/src/auth/passport.js +0 -21
- package/src/db.js +0 -13
- package/test-server/.env.development +0 -1
- package/test-server/.env.production +0 -1
- package/test-server/index.js +0 -82
- package/test-server/package-lock.json +0 -1267
- package/test-server/package.json +0 -20
- package/test-server/public/index.html +0 -90
package/skeleton/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import express from "express";
|
|
2
2
|
import dotenv from "dotenv";
|
|
3
|
-
import bodyParser from "body-parser";
|
|
4
3
|
import path from "path";
|
|
5
4
|
import cors from "cors";
|
|
6
5
|
import os from "os";
|
|
@@ -12,10 +11,18 @@ const app = express();
|
|
|
12
11
|
const port = process.env.PORT || 3000;
|
|
13
12
|
|
|
14
13
|
// Middleware
|
|
15
|
-
app.use(
|
|
16
|
-
app.use(
|
|
14
|
+
app.use(express.json({ limit: "50mb" }));
|
|
15
|
+
app.use(express.urlencoded({ extended: true, limit: "50mb" }));
|
|
17
16
|
app.use(cors({ origin: "*" }));
|
|
18
17
|
|
|
18
|
+
// Dev dashboard (only in development)
|
|
19
|
+
if (env === "development") {
|
|
20
|
+
try {
|
|
21
|
+
const devApi = await import("./dev-api.js");
|
|
22
|
+
app.use("/_dev", devApi.default);
|
|
23
|
+
} catch {}
|
|
24
|
+
}
|
|
25
|
+
|
|
19
26
|
// Serve static files from the public directory
|
|
20
27
|
const __dirname = path.resolve();
|
|
21
28
|
app.use(express.static(path.join(__dirname, "public")));
|
package/skeleton/package.json
CHANGED
|
@@ -7,13 +7,17 @@
|
|
|
7
7
|
"start": "node index.js",
|
|
8
8
|
"dev": "nodemon index.js"
|
|
9
9
|
},
|
|
10
|
+
"nodemonConfig": {
|
|
11
|
+
"watch": ["."],
|
|
12
|
+
"ext": "js,mjs,cjs",
|
|
13
|
+
"ignore": ["node_modules/", "package.json", "package-lock.json"]
|
|
14
|
+
},
|
|
10
15
|
"dependencies": {
|
|
11
|
-
"express": "^
|
|
12
|
-
"dotenv": "^
|
|
13
|
-
"
|
|
14
|
-
"cors": "^2.8.5"
|
|
16
|
+
"express": "^5.2.1",
|
|
17
|
+
"dotenv": "^17.3.1",
|
|
18
|
+
"cors": "^2.8.6"
|
|
15
19
|
},
|
|
16
20
|
"devDependencies": {
|
|
17
|
-
"nodemon": "^3.1.
|
|
21
|
+
"nodemon": "^3.1.14"
|
|
18
22
|
}
|
|
19
23
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|