fddevpay 1.0.1 → 1.0.2
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/index.js +14 -5
- package/package.json +6 -2
- package/desktop.ini +0 -6
- package/fdpayDashboard-main/desktop.ini +0 -6
- package/fdpaydashboard-1.0.0.tgz +0 -0
package/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
|
|
2
3
|
import express from "express";
|
|
3
4
|
import path from "path";
|
|
4
5
|
import open from "open";
|
|
@@ -7,18 +8,26 @@ import { fileURLToPath } from "url";
|
|
|
7
8
|
const app = express();
|
|
8
9
|
const PORT = process.env.PORT || 4000;
|
|
9
10
|
|
|
10
|
-
// ✅ Fix
|
|
11
|
+
// ✅ Fix __dirname in ESM
|
|
11
12
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
13
|
const __dirname = path.dirname(__filename);
|
|
13
14
|
|
|
14
|
-
//
|
|
15
|
+
// ✅ Serve static files
|
|
15
16
|
app.use(express.static(path.join(__dirname, "dist")));
|
|
16
17
|
|
|
18
|
+
// ✅ Handle SPA routes safely
|
|
17
19
|
app.get("*", (req, res) => {
|
|
18
20
|
res.sendFile(path.join(__dirname, "dist", "index.html"));
|
|
19
21
|
});
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
// ✅ Start server
|
|
24
|
+
app.listen(PORT, async () => {
|
|
25
|
+
const url = `http://localhost:${PORT}`;
|
|
26
|
+
console.log(`🚀 FDDevPay running at ${url}`);
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
await open(url);
|
|
30
|
+
} catch (err) {
|
|
31
|
+
console.log("Browser open failed ❌");
|
|
32
|
+
}
|
|
24
33
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fddevpay",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,5 +16,9 @@
|
|
|
16
16
|
},
|
|
17
17
|
"bin": {
|
|
18
18
|
"fddevpay": "index.js"
|
|
19
|
-
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"index.js"
|
|
23
|
+
]
|
|
20
24
|
}
|
package/desktop.ini
DELETED
package/fdpaydashboard-1.0.0.tgz
DELETED
|
Binary file
|