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 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 for __dirname in ESM
11
+ // ✅ Fix __dirname in ESM
11
12
  const __filename = fileURLToPath(import.meta.url);
12
13
  const __dirname = path.dirname(__filename);
13
14
 
14
- // serve Vite dist folder
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
- app.listen(PORT, () => {
22
- console.log(`🚀 Dashboard running at http://localhost:${PORT}`);
23
- open(`http://localhost:${PORT}`);
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.1",
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
@@ -1,6 +0,0 @@
1
- [.ShellClassInfo]
2
- IconResource=C:\WINDOWS\System32\SHELL32.dll,41
3
- [ViewState]
4
- Mode=
5
- Vid=
6
- FolderType=Generic
@@ -1,6 +0,0 @@
1
- [.ShellClassInfo]
2
- IconResource=C:\WINDOWS\System32\SHELL32.dll,33
3
- [ViewState]
4
- Mode=
5
- Vid=
6
- FolderType=Generic
Binary file