CLI and Publish Tests

This commit was merged in pull request #63.
This commit is contained in:
2026-06-02 12:12:38 -04:00
parent 7da6f554a8
commit 85834466f1
71 changed files with 511 additions and 54 deletions
+51
View File
@@ -0,0 +1,51 @@
# Publishing and Serving the IGP App Locally
## Steps Performed
### 1. Publish the Blazor WebAssembly App
Ran `dotnet publish` targeting Release configuration, outputting to `publish_release/`:
```
dotnet publish .\IGP\IGP.csproj -c Release -o .\publish_release
```
This produced a standard Blazor WASM publish layout:
- `publish_release/wwwroot/` — static assets (HTML, CSS, JS, WASM, DLLs)
- `publish_release/dotnet.js` — .NET runtime loader
- `publish_release/web.config` — IIS configuration
### 2. Serve the Published Files on Port 8777
Wrote a small Node.js static file server (`serve_publish.cjs`) that:
- Serves files from `publish_release/wwwroot/`
- Maps correct MIME types for `.wasm` ( `application/wasm` ), `.dll` ( `application/octet-stream` ), `.js` ( `application/javascript` ), `.br`, `.gz`
- Implements SPA fallback: non-file routes serve `index.html` so Blazor's client-side routing works on refresh
```
node serve_publish.cjs
```
Server is now running at **http://localhost:8777**.
### 3. Verify
- `netstat -ano | findstr ":8777"` confirms the process is LISTENING
- `curl -s -o NUL -w "%{http_code}" http://localhost:8777/` returns `200`
## How to Stop
Find the process and kill it:
```
netstat -ano | findstr ":8777.*LISTENING"
Stop-Process -Id <PID>
```
## Files
| File | Purpose |
|---|---|
| `publish_release/wwwroot/` | Published static output |
| `serve_publish.cjs` | Simple Node.js HTTP server with Blazor MIME support |