wirejs-deploy-amplify-basic 0.0.57 → 0.0.59

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.
@@ -92,15 +92,19 @@ function routeSSR(context, forceExt) {
92
92
  ? toJSPath(context.location.pathname)
93
93
  : context.location.pathname;
94
94
 
95
- const allHandlers = fs.readdirSync(SSR_ROOT, { recursive: true })
96
- .filter(p => p.endsWith('.js'))
97
- .map(p => `/${p}`)
98
- ;
99
- const matchingHandlers = allHandlers.filter(h => globMatch(h, asJSPath));
100
- const match = matchingHandlers.sort(byLength).pop();
101
-
102
- if (match) {
103
- return path.join(SSR_ROOT, match);
95
+ try {
96
+ const allHandlers = fs.readdirSync(SSR_ROOT, { recursive: true })
97
+ .filter(p => p.endsWith('.js'))
98
+ .map(p => `/${p}`)
99
+ ;
100
+ const matchingHandlers = allHandlers.filter(h => globMatch(h, asJSPath));
101
+ const match = matchingHandlers.sort(byLength).pop();
102
+
103
+ if (match) {
104
+ return path.join(SSR_ROOT, match);
105
+ }
106
+ } catch (error) {
107
+ return;
104
108
  }
105
109
  }
106
110
 
@@ -210,6 +214,11 @@ async function tryAPIPath(req, res) {
210
214
  logger.error('Tried to proxy without API_URL config.');
211
215
  return false;
212
216
  }
217
+
218
+ if (!req.url.startsWith('/api')) {
219
+ return false;
220
+ }
221
+
213
222
  return proxyRequest(req, res, API_URL);
214
223
  }
215
224
 
@@ -3,6 +3,6 @@
3
3
  "dependencies": {
4
4
  "jsdom": "^25.0.1",
5
5
  "wirejs-dom": "^1.0.38",
6
- "wirejs-resources": "^0.1.25"
6
+ "wirejs-resources": "^0.1.27"
7
7
  }
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-deploy-amplify-basic",
3
- "version": "0.0.57",
3
+ "version": "0.0.59",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "recursive-copy": "^2.0.14",
31
31
  "rimraf": "^6.0.1",
32
32
  "wirejs-dom": "^1.0.38",
33
- "wirejs-resources": "^0.1.25"
33
+ "wirejs-resources": "^0.1.27"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@aws-amplify/backend": "^1.14.0",