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:
57
Sky_Art_shop/quick-update.ps1
Normal file
57
Sky_Art_shop/quick-update.ps1
Normal file
@@ -0,0 +1,57 @@
|
||||
# Quick View Update - Copy changed view files without restarting site
|
||||
# Run this after editing views to update live site without downtime
|
||||
|
||||
param(
|
||||
[string]$ViewFile = ""
|
||||
)
|
||||
|
||||
$devPath = "E:\Documents\Website Projects\Sky_Art_Shop"
|
||||
$prodPath = "C:\inetpub\wwwroot\skyartshop"
|
||||
|
||||
if ($ViewFile) {
|
||||
# Copy specific file
|
||||
$sourceFile = Join-Path $devPath $ViewFile
|
||||
$destFile = Join-Path $prodPath $ViewFile
|
||||
|
||||
if (Test-Path $sourceFile) {
|
||||
$destDir = Split-Path $destFile -Parent
|
||||
if (-not (Test-Path $destDir)) {
|
||||
New-Item -ItemType Directory -Path $destDir -Force | Out-Null
|
||||
}
|
||||
Copy-Item $sourceFile $destFile -Force
|
||||
Write-Host "✅ Updated: $ViewFile" -ForegroundColor Green
|
||||
|
||||
# Touch web.config to trigger reload without restart
|
||||
$webConfig = Join-Path $prodPath "web.config"
|
||||
if (Test-Path $webConfig) {
|
||||
(Get-Item $webConfig).LastWriteTime = Get-Date
|
||||
Write-Host "✅ Site reloaded automatically (no downtime)" -ForegroundColor Cyan
|
||||
}
|
||||
}
|
||||
else {
|
||||
Write-Host "❌ File not found: $sourceFile" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Sync all Views
|
||||
Write-Host "🔄 Syncing all views..." -ForegroundColor Cyan
|
||||
|
||||
$viewsSource = Join-Path $devPath "Views"
|
||||
$viewsDest = Join-Path $prodPath "Views"
|
||||
|
||||
if (Test-Path $viewsSource) {
|
||||
Copy-Item -Path $viewsSource -Destination $prodPath -Recurse -Force
|
||||
Write-Host "✅ All views synced" -ForegroundColor Green
|
||||
|
||||
# Touch web.config
|
||||
$webConfig = Join-Path $prodPath "web.config"
|
||||
if (Test-Path $webConfig) {
|
||||
(Get-Item $webConfig).LastWriteTime = Get-Date
|
||||
Write-Host "✅ Site reloaded automatically" -ForegroundColor Cyan
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "`n💡 Usage examples:" -ForegroundColor Yellow
|
||||
Write-Host " .\quick-update.ps1 # Sync all views"
|
||||
Write-Host " .\quick-update.ps1 'Views\Shared\_AdminLayout.cshtml' # Update specific view"
|
||||
Reference in New Issue
Block a user