first commit
29
README.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# Thiệp cưới — chạy trên Windows
|
||||||
|
|
||||||
|
Website tĩnh (Ladipage). Cần chạy qua **web server cục bộ** — không mở trực tiếp file `index.html` bằng double-click (ảnh/JS sẽ lỗi).
|
||||||
|
|
||||||
|
## Cách nhanh nhất
|
||||||
|
|
||||||
|
1. Double-click file **`start.bat`** trong thư mục dự án.
|
||||||
|
2. Trình duyệt sẽ mở: `http://localhost:8080/www.mewedding.vn/index.html`
|
||||||
|
3. Dừng server: nhấn `Ctrl+C` trong cửa sổ đen (hoặc đóng cửa sổ).
|
||||||
|
|
||||||
|
## Chạy bằng PowerShell
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
cd "D:\Thiệp Cứoi\Wed-dt"
|
||||||
|
powershell -ExecutionPolicy Bypass -File .\serve.ps1
|
||||||
|
```
|
||||||
|
|
||||||
|
Nếu Windows chặn script lần đầu, chạy một lần:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
|
||||||
|
```
|
||||||
|
|
||||||
|
## Deploy lên server (Kubernetes)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kubectl -n wedding rollout restart deploy/wedding-web
|
||||||
|
kubectl -n wedding rollout status deploy/wedding-web
|
||||||
|
```
|
||||||
107
serve.ps1
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
# Simple static file server for the wedding site (Windows, no Node/Python required)
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
$root = $PSScriptRoot
|
||||||
|
$port = 8080
|
||||||
|
|
||||||
|
$mime = @{
|
||||||
|
".html" = "text/html; charset=utf-8"
|
||||||
|
".htm" = "text/html; charset=utf-8"
|
||||||
|
".css" = "text/css; charset=utf-8"
|
||||||
|
".js" = "application/javascript; charset=utf-8"
|
||||||
|
".json" = "application/json; charset=utf-8"
|
||||||
|
".png" = "image/png"
|
||||||
|
".jpg" = "image/jpeg"
|
||||||
|
".jpeg" = "image/jpeg"
|
||||||
|
".gif" = "image/gif"
|
||||||
|
".svg" = "image/svg+xml"
|
||||||
|
".webp" = "image/webp"
|
||||||
|
".woff" = "font/woff"
|
||||||
|
".woff2" = "font/woff2"
|
||||||
|
".ttf" = "font/ttf"
|
||||||
|
".otf" = "font/otf"
|
||||||
|
".mp3" = "audio/mpeg"
|
||||||
|
".mp4" = "video/mp4"
|
||||||
|
".ico" = "image/x-icon"
|
||||||
|
}
|
||||||
|
|
||||||
|
function Get-ContentType([string]$path) {
|
||||||
|
$ext = [System.IO.Path]::GetExtension($path).ToLowerInvariant()
|
||||||
|
if ($mime.ContainsKey($ext)) { return $mime[$ext] }
|
||||||
|
return "application/octet-stream"
|
||||||
|
}
|
||||||
|
|
||||||
|
function Send-File([System.Net.HttpListenerContext]$ctx, [string]$filePath) {
|
||||||
|
$bytes = [System.IO.File]::ReadAllBytes($filePath)
|
||||||
|
$ctx.Response.ContentType = Get-ContentType $filePath
|
||||||
|
$ctx.Response.ContentLength64 = $bytes.Length
|
||||||
|
$ctx.Response.OutputStream.Write($bytes, 0, $bytes.Length)
|
||||||
|
}
|
||||||
|
|
||||||
|
$listener = New-Object System.Net.HttpListener
|
||||||
|
$listener.Prefixes.Add("http://localhost:$port/")
|
||||||
|
$listener.Start()
|
||||||
|
|
||||||
|
$url = "http://localhost:$port/www.mewedding.vn/index.html"
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host " Thiep cuoi dang chay tai:" -ForegroundColor Green
|
||||||
|
Write-Host " $url" -ForegroundColor Cyan
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host " Nhan Ctrl+C de dung server." -ForegroundColor DarkGray
|
||||||
|
Write-Host ""
|
||||||
|
|
||||||
|
try {
|
||||||
|
Start-Process $url | Out-Null
|
||||||
|
} catch {
|
||||||
|
Write-Host " Mo trinh duyet thu cong: $url" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
|
||||||
|
while ($listener.IsListening) {
|
||||||
|
$context = $listener.GetContext()
|
||||||
|
$request = $context.Request
|
||||||
|
$response = $context.Response
|
||||||
|
|
||||||
|
try {
|
||||||
|
$rawPath = $request.Url.LocalPath
|
||||||
|
if ([string]::IsNullOrWhiteSpace($rawPath) -or $rawPath -eq "/") {
|
||||||
|
$rawPath = "/www.mewedding.vn/index.html"
|
||||||
|
}
|
||||||
|
|
||||||
|
$relative = [System.Uri]::UnescapeDataString($rawPath).TrimStart("/").Replace("/", [IO.Path]::DirectorySeparatorChar)
|
||||||
|
$filePath = Join-Path $root $relative
|
||||||
|
$filePath = [IO.Path]::GetFullPath($filePath)
|
||||||
|
|
||||||
|
if (-not $filePath.StartsWith([IO.Path]::GetFullPath($root), [StringComparison]::OrdinalIgnoreCase)) {
|
||||||
|
$response.StatusCode = 403
|
||||||
|
$buf = [Text.Encoding]::UTF8.GetBytes("403 Forbidden")
|
||||||
|
$response.OutputStream.Write($buf, 0, $buf.Length)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Test-Path $filePath -PathType Container) {
|
||||||
|
$index = Join-Path $filePath "index.html"
|
||||||
|
if (Test-Path $index) { $filePath = $index } else {
|
||||||
|
$response.StatusCode = 404
|
||||||
|
$buf = [Text.Encoding]::UTF8.GetBytes("404 Not Found")
|
||||||
|
$response.OutputStream.Write($buf, 0, $buf.Length)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not (Test-Path $filePath -PathType Leaf)) {
|
||||||
|
$response.StatusCode = 404
|
||||||
|
$buf = [Text.Encoding]::UTF8.GetBytes("404 Not Found: $rawPath")
|
||||||
|
$response.OutputStream.Write($buf, 0, $buf.Length)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
Send-File $context $filePath
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
$response.StatusCode = 500
|
||||||
|
$msg = [Text.Encoding]::UTF8.GetBytes($_.Exception.Message)
|
||||||
|
$response.OutputStream.Write($msg, 0, $msg.Length)
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
$response.Close()
|
||||||
|
}
|
||||||
|
}
|
||||||
8
start.bat
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
@echo off
|
||||||
|
chcp 65001 >nul
|
||||||
|
cd /d "%~dp0"
|
||||||
|
echo.
|
||||||
|
echo Dang khoi dong server thiep cuoi...
|
||||||
|
echo.
|
||||||
|
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0serve.ps1"
|
||||||
|
pause
|
||||||
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 119 KiB |
BIN
w.ladicdn.com/5c728619c417ab07e5194baa/QR cô dâu.jpg
Normal file
|
After Width: | Height: | Size: 95 KiB |
BIN
w.ladicdn.com/5c728619c417ab07e5194baa/QrChuRe.jpg
Normal file
|
After Width: | Height: | Size: 204 KiB |
|
After Width: | Height: | Size: 2.2 MiB |
|
After Width: | Height: | Size: 123 KiB |
|
After Width: | Height: | Size: 3.8 MiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 79 KiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_4555.jpg
Normal file
|
After Width: | Height: | Size: 10 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_4659.jpg
Normal file
|
After Width: | Height: | Size: 8.5 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_4987.jpg
Normal file
|
After Width: | Height: | Size: 7.4 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_5057.jpg
Normal file
|
After Width: | Height: | Size: 12 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_5327.jpg
Normal file
|
After Width: | Height: | Size: 9.6 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_5380.jpg
Normal file
|
After Width: | Height: | Size: 9.4 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_5413.jpg
Normal file
|
After Width: | Height: | Size: 9.6 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_5427.jpg
Normal file
|
After Width: | Height: | Size: 8.9 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_5477.jpg
Normal file
|
After Width: | Height: | Size: 8.9 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_5487.jpg
Normal file
|
After Width: | Height: | Size: 9.9 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_5606.jpg
Normal file
|
After Width: | Height: | Size: 9.9 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_5731.jpg
Normal file
|
After Width: | Height: | Size: 11 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_5773.jpg
Normal file
|
After Width: | Height: | Size: 10 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_5778.jpg
Normal file
|
After Width: | Height: | Size: 9.9 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_5801.jpg
Normal file
|
After Width: | Height: | Size: 11 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_5977.jpg
Normal file
|
After Width: | Height: | Size: 14 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_6034.jpg
Normal file
|
After Width: | Height: | Size: 12 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_6073.jpg
Normal file
|
After Width: | Height: | Size: 15 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_6102.jpg
Normal file
|
After Width: | Height: | Size: 16 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_6196.jpg
Normal file
|
After Width: | Height: | Size: 14 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_6222.jpg
Normal file
|
After Width: | Height: | Size: 13 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_6266.jpg
Normal file
|
After Width: | Height: | Size: 15 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_6478.jpg
Normal file
|
After Width: | Height: | Size: 14 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_6583.jpg
Normal file
|
After Width: | Height: | Size: 13 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_6644.jpg
Normal file
|
After Width: | Height: | Size: 15 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_6688.jpg
Normal file
|
After Width: | Height: | Size: 15 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_6712.jpg
Normal file
|
After Width: | Height: | Size: 13 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_6738.jpg
Normal file
|
After Width: | Height: | Size: 14 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_6949.jpg
Normal file
|
After Width: | Height: | Size: 14 MiB |
BIN
w.ladicdn.com/PREWEDDING THANH NHAN - MINH HIEP/NLV_6957.jpg
Normal file
|
After Width: | Height: | Size: 12 MiB |
|
After Width: | Height: | Size: 112 KiB |
|
After Width: | Height: | Size: 173 KiB |
|
After Width: | Height: | Size: 489 KiB |
|
After Width: | Height: | Size: 704 KiB |
|
After Width: | Height: | Size: 211 KiB |
|
After Width: | Height: | Size: 608 KiB |
|
After Width: | Height: | Size: 779 KiB |
|
After Width: | Height: | Size: 98 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 684 KiB |
|
After Width: | Height: | Size: 664 KiB |
|
After Width: | Height: | Size: 511 KiB |
|
After Width: | Height: | Size: 159 KiB |
|
After Width: | Height: | Size: 2.1 MiB |
|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 1.6 MiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 208 KiB |
|
After Width: | Height: | Size: 118 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 519 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 266 KiB |
|
After Width: | Height: | Size: 145 KiB |
|
After Width: | Height: | Size: 243 KiB |
|
After Width: | Height: | Size: 666 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 255 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 375 KiB |
|
After Width: | Height: | Size: 167 KiB |
|
After Width: | Height: | Size: 546 KiB |
|
After Width: | Height: | Size: 248 KiB |
|
After Width: | Height: | Size: 250 KiB |
|
After Width: | Height: | Size: 219 KiB |
|
After Width: | Height: | Size: 255 KiB |
|
After Width: | Height: | Size: 161 KiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 168 KiB |
|
After Width: | Height: | Size: 105 KiB |
|
After Width: | Height: | Size: 304 KiB |
|
After Width: | Height: | Size: 252 KiB |
|
After Width: | Height: | Size: 272 KiB |
|
After Width: | Height: | Size: 281 KiB |
|
After Width: | Height: | Size: 601 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 241 KiB |
|
After Width: | Height: | Size: 151 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 318 KiB |