$ErrorActionPreference = 'Stop' $base = 'http://127.0.0.1:3000' $session = New-Object Microsoft.PowerShell.Commands.WebRequestSession function Req($method, $path, $bodyObj) { $p = @{ Method = $method; Uri = "$base$path"; UseBasicParsing = $true; WebSession = $session; ErrorAction = 'Stop' } if ($null -ne $bodyObj) { $p.Body = ($bodyObj | ConvertTo-Json -Depth 6 -Compress); $p.ContentType = 'application/json' } Invoke-WebRequest @p } Write-Output 'waiting for health...' $up = $false for ($i = 0; $i -lt 40; $i++) { try { if ((Invoke-WebRequest "$base/api/health" -UseBasicParsing).StatusCode -eq 200) { $up = $true; break } } catch {} Start-Sleep -Seconds 2 } if (-not $up) { Write-Output 'server never came up'; return } Req POST '/api/v1/auth/login' @{ username = 'admin'; password = 'adminpass123' } | Out-Null Req PUT '/api/v1/admin/site-mode' @{ mode = 'live' } | Out-Null # News Req POST '/api/v1/admin/posts' @{ category='news'; title='The world map enters closed testing'; excerpt='The Mysticmoon overworld is feature-complete enough for a small group to wander.'; body='

Travel between the three starting towns is live, moongates are seeded, and the first dungeon level is open for stress-testing.

'; published=$true } | Out-Null Req POST '/api/v1/admin/posts' @{ category='news'; title='Crafting trees and resource gathering'; excerpt='Mining, lumberjacking, and the first tier of smithing and tailoring are in.'; body='

Resource respawn timers are tuned for a small population.

'; published=$true } | Out-Null # Five on Friday Req POST '/api/v1/admin/posts' @{ category='five-on-friday'; title='Five on Friday #07'; body='
  1. Moongates now route correctly between all three regions.
  2. The blacksmith UI got a readability pass.
  3. Something large now lurks in the Hollow Deeps.
  4. Next week: player housing placement rules.
  5. The full-moon lighting in town looks lovely.
'; published=$true } | Out-Null # Newsletter Req POST '/api/v1/admin/posts' @{ category='newsletter'; slug='june-2026'; title='A world you can walk across'; excerpt='The longest month of building yet - here is everything that landed.'; body='

June was the month Mysticmoon stopped being a set of disconnected systems and started feeling like a place.

The overworld opens

For the first time, testers walked the road from Mistholme to the eastern moongate.

Crafting takes root

Mining, lumberjacking, smithing, and tailoring all came online.

'; published=$true } | Out-Null # Screenshot (uses the hero image already served at /assets) Req POST '/api/v1/admin/posts' @{ category='screenshots'; title='Mistholme at dusk'; excerpt='The square at Mistholme, lanterns lit at dusk.'; image_url='/assets/img/uomysticmoon-main-hero.png'; published=$true } | Out-Null # Wiki body with H2 sections so the article TOC renders Req PUT '/api/v1/admin/wiki/new-player-guide' @{ title='New Player Guide'; body='

Everything you need to find your feet in your first hour on Mysticmoon.

When you arrive

New characters wake in Mistholme, the central starting town.

Choosing your first skills

You do not pick a class - you grow into one by using skills.

Staying alive

' } | Out-Null Write-Output 'SETUP DONE - site is live with sample content'