vibe-gx 3.0.0 → 3.1.0

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 (3) hide show
  1. package/README.md +37 -1
  2. package/package.json +1 -1
  3. package/vibe.js +1 -0
package/README.md CHANGED
@@ -269,7 +269,7 @@ app.post(
269
269
  {
270
270
  media: {
271
271
  dest: "uploads", // Subfolder destination
272
- public: true, // Save inside public folder (default: true)
272
+ public: true, // Save in public folder (default: true)
273
273
  maxSize: 5 * 1024 * 1024, // Max file size: 5MB
274
274
  allowedTypes: ["image/jpeg", "image/png", "image/*"], // Wildcards supported
275
275
  },
@@ -278,6 +278,42 @@ app.post(
278
278
  );
279
279
  ```
280
280
 
281
+ ### Public vs Private Uploads
282
+
283
+ **Public uploads** (web-accessible):
284
+
285
+ ```javascript
286
+ app.post(
287
+ "/upload/avatar",
288
+ {
289
+ media: {
290
+ public: true, // ✅ Files accessible via HTTP
291
+ dest: "avatars", // Saved to: public/avatars/
292
+ },
293
+ },
294
+ handler,
295
+ );
296
+
297
+ // Files accessible at: http://yourapp.com/avatars/filename.jpg
298
+ ```
299
+
300
+ **Private uploads** (server-only access):
301
+
302
+ ```javascript
303
+ app.post(
304
+ "/upload/documents",
305
+ {
306
+ media: {
307
+ public: false, // 🔒 Files NOT web-accessible
308
+ dest: "documents", // Saved to: private/documents/
309
+ },
310
+ },
311
+ handler,
312
+ );
313
+
314
+ // Files only accessible via your backend code (e.g., sendAbsoluteFile)
315
+ ```
316
+
281
317
  ### Uploaded File Object
282
318
 
283
319
  ```javascript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-gx",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "A lightweight, high-performance Node.js web framework.",
5
5
  "type": "module",
6
6
  "main": "vibe.js",
package/vibe.js CHANGED
@@ -474,6 +474,7 @@ const vibe = () => {
474
474
  const route = {
475
475
  method: "GET",
476
476
  path: routePath,
477
+ pathRegex: pathToRegex(routePath),
477
478
  handler: (req, res) => {
478
479
  try {
479
480
  const filePath = req.url