import { StrictMode } from 'react'
import {
  type RenderToPipeableStreamOptions,
  renderToPipeableStream,
} from 'react-dom/server'
// import App from '../App'

export function render(_url: string, options?: RenderToPipeableStreamOptions) {
  return renderToPipeableStream(
    <StrictMode>
      {!_url.startsWith('/admin') && <script src="https://g.alicdn.com/apsara-media-box/imp-interaction/1.8.0/alivc-im.iife.js"></script>}
      {/* <App /> */}
    </StrictMode>,
    options,
  )
}


import { renderToStaticMarkup } from 'react-dom/server'
import { Rooter } from './renderer';

// 使用renderToStaticMarkup - 不会包含React内部属性，生成纯静态HTML
export const template = renderToStaticMarkup(
  <Rooter />
);

// 导出 API 路由
export { default as api } from './api';

// 导出 Socket.IO 相关功能
export { default as socketHandler, authMiddleware as socketAuthMiddleware } from './socket';


