2025-12-2genxin
This commit is contained in:
@@ -27,6 +27,9 @@ echo.
|
||||
echo 💡 提示: 按 Ctrl+C 停止服务器
|
||||
echo ===============================================
|
||||
echo.
|
||||
echo 🌐 正在打开浏览器...
|
||||
start http://localhost:8000/frontend.html
|
||||
echo.
|
||||
|
||||
cd /d "%~dp0"
|
||||
python -m http.server 8000
|
||||
@@ -48,7 +51,7 @@ $listener.Prefixes.Add('http://localhost:8080/')
|
||||
$listener.Start()
|
||||
Write-Host '✅ Web服务器已启动: http://localhost:8080'
|
||||
Write-Host '🌐 正在打开浏览器...'
|
||||
Start-Process 'http://localhost:8080'
|
||||
Start-Process 'http://localhost:8080/frontend.html'
|
||||
|
||||
while ($listener.IsListening) {
|
||||
$context = $listener.GetContext()
|
||||
@@ -56,7 +59,7 @@ while ($listener.IsListening) {
|
||||
$response = $context.Response
|
||||
|
||||
$path = $request.Url.LocalPath
|
||||
if ($path -eq '/') { $path = '/index.html' }
|
||||
if ($path -eq '/') { $path = '/frontend.html' }
|
||||
|
||||
$filePath = Join-Path (Get-Location) $path.TrimStart('/')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user