Fix admin route access and backend configuration
- Added /admin redirect to login page in nginx config - Fixed backend server.js route ordering for proper admin handling - Updated authentication middleware and routes - Added user management routes - Configured PostgreSQL integration - Updated environment configuration
This commit is contained in:
20
Sky_Art_shop/fix-image-urls.js
Normal file
20
Sky_Art_shop/fix-image-urls.js
Normal file
@@ -0,0 +1,20 @@
|
||||
// Fix Product Image URLs - Replace absolute URLs with relative paths
|
||||
// Run this in browser console on admin page: http://skyarts.ddns.net/admin
|
||||
|
||||
(async function () {
|
||||
console.log("🔧 Fixing product image URLs...");
|
||||
|
||||
// This would need to be run server-side to fix MongoDB
|
||||
// For now, manually edit the product with broken image through admin interface
|
||||
|
||||
console.log("⚠️ Manual fix required:");
|
||||
console.log("1. Go to Admin → Products");
|
||||
console.log(
|
||||
'2. Find product with image: "http://localhost:5001/uploads/images/de3ee948-a476-40a6-b31b-d226549b762d.jpg"'
|
||||
);
|
||||
console.log("3. Edit the product");
|
||||
console.log(
|
||||
'4. In ImageUrl field, change to: "/uploads/images/de3ee948-a476-40a6-b31b-d226549b762d.jpg"'
|
||||
);
|
||||
console.log("5. Save");
|
||||
})();
|
||||
Reference in New Issue
Block a user