create-aziz-app 3.0.0 → 3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-aziz-app",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Create Aziz.js apps — lightweight Next.js clone with file-based routing, React hooks, and API routes",
5
5
  "keywords": [
6
6
  "aziz.js",
@@ -329,21 +329,24 @@ const server = http.createServer(async (req, res) => {
329
329
  }
330
330
 
331
331
  // ── Static files
332
- let filePath = path.join(ROOT, urlWithoutQuery);
332
+ let filePath;
333
333
 
334
- // Default to index.html
334
+ // Root → index.html
335
335
  if (urlWithoutQuery === '/' || urlWithoutQuery === '') {
336
336
  filePath = path.join(ROOT, 'index.html');
337
- }
338
-
339
- // SPA fallback: any path without extension → index.html
340
- const ext = path.extname(urlWithoutQuery);
341
- if (!ext && urlWithoutQuery !== '/') {
342
- filePath = path.join(ROOT, 'index.html');
337
+ } else {
338
+ filePath = path.join(ROOT, urlWithoutQuery);
339
+
340
+ // SPA fallback: path with no file extension → serve index.html
341
+ // so the client-side router handles it
342
+ const ext = path.extname(urlWithoutQuery);
343
+ if (!ext) {
344
+ filePath = path.join(ROOT, 'index.html');
345
+ }
343
346
  }
344
347
 
345
348
  if (!fs.existsSync(filePath)) {
346
- // Try with .js extension
349
+ // Try appending .js
347
350
  if (fs.existsSync(filePath + '.js')) {
348
351
  filePath = filePath + '.js';
349
352
  } else {