directory structure of wix

chatgpt gave me that. tbh doesnt look that bad, i will try that tomorrow. never had to deal with “wix”-routers. btw, wix means something very rude/nasty in germany :wink:

import wixRouter from 'wix-router';

// create router for /autodiscovery.xml
export function myRouter(request) {
  const path = request.path;
  if (path === '/.well-known/autodiscovery.xml') {
    const xmlContent = `<?xml version="1.0" encoding="UTF-8"?>
      <autodiscovery>
        <url>http://www.mydomain.com</url>
      </autodiscovery>`;
    return {
      body: xmlContent,
      headers: {
        'Content-Type': 'application/xml'
      }
    };
  }
}

// register the router
$w.onReady(() => {
  wixRouter.registerRoute('/.well-known/autodiscovery.xml', myRouter);
});