INNER CODE UNIT · TypeScript

main

YGYOOO/WorldX · server/src/index.ts:60

async function main() {
  const app = express();
  app.use(cors());
  app.use(express.json());

  const worldDir = resolveInitialWorldDir();
  if (worldDir) {
    console.log(`[WorldX] World dir: ${worldDir}`);
  } else {
    console.log("[WorldX] No generated world found — server starting in empty mode. Navigate to /create to generate your first world.");
  }

  await appContext.initialize(worldDir);
  console.log("[WorldX] All systems initialized");

  app.get("/api/health", (_req, res) => {
    if (!appContext.hasWorld) {
      res.json({ status: "ok", project: "world-x", worldName: null, sceneConfig: null });

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…