@nikelyh/metamorph 2.0.3 → 2.0.5

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1092,10 +1092,13 @@ async function createApiServer(store, migrationRunner) {
1092
1092
  }
1093
1093
  const path6 = await import("path");
1094
1094
  const fs7 = await import("fs");
1095
- const publicDir = path6.join(import.meta.dirname, "../public");
1095
+ let publicDir = path6.join(import.meta.dirname, "public");
1096
+ if (!fs7.existsSync(publicDir)) {
1097
+ publicDir = path6.join(import.meta.dirname, "../public");
1098
+ }
1096
1099
  if (fs7.existsSync(publicDir)) {
1097
1100
  app.use(express.static(publicDir));
1098
- app.get("*", (_req, res) => {
1101
+ app.get(/^(.*)$/, (_req, res) => {
1099
1102
  res.sendFile(path6.join(publicDir, "index.html"));
1100
1103
  });
1101
1104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nikelyh/metamorph",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "main": "dist/index.js",
5
5
  "bin": {
6
6
  "metamorph": "./bin/metamorph.js"