Organize client, server, and adapter entry points for an MMORPG project, with an Express example.
MMORPG entries
When RPG_TYPE=mmorpg, RPGJS now treats your project as a multi-entry application:
a browser client
a framework-agnostic server module
optional hosting adapters such as Express
Use this layout when you want to keep your game server portable across:
Vite development
Express in production
another Node host such as Fastify or Hono
a custom deployment target later
RPG_TYPE defaults to rpg when it is not set. If this is your first online
deployment, start with Put an MMORPG online, which covers
local verification, map publication, Node/Docker, and Cloudflare.
Recommended structure
Keep your game logic in src/server.ts, and put host-specific bootstraps in src/entries.
src/server.ts: RPGJS server module, without express(), listen(), or platform code
src/entries/express.ts: Node entry that mounts src/server.ts in Express
src/standalone.ts: browser entry for RPG_TYPE=rpg
Configure rpgjs()
Declare the MMORPG entries explicitly in your Vite config.
import { defineConfig } from "vite"import { rpgjs, tiledMapFolderPlugin } from "@rpgjs/vite"import vue from "@vitejs/plugin-vue"import serverModule from "./src/server"export default defineConfig({ plugins: [ vue(), tiledMapFolderPlugin({ sourceFolder: "./src/tiled", publicPath: "/map", buildOutputPath: "assets/data", // Keep authoritative Tiled sources out of the browser build. allowedExtensions: [".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg"], }), ...rpgjs({ server: serverModule, entryPoints: { rpg: "./src/standalone.ts", mmorpg: { client: "./src/client.ts", server: "./src/server.ts", adapters: { express: "./src/entries/express.ts", }, }, }, }), ],})
Keep src/server.ts agnostic
src/server.ts should export your RPGJS server module and nothing else.It should not:
create an HTTP server
call listen()
import Express directly
depend on a specific host runtime
Example:
import { createServer, provideServerModules } from "@rpgjs/server"import mainServerModule from "./modules/server"export default createServer({ providers: [ provideServerModules([mainServerModule]), ],})
This file is the canonical server entry for your game. Vite development can use it directly, and production adapters can import it without duplicating game setup.
Express adapter example
Put your Express bootstrap in src/entries/express.ts.
import express from "express"import { createServer } from "node:http"import { dirname, join, resolve } from "node:path"import { fileURLToPath } from "node:url"import { WebSocketServer } from "ws"import { createRpgServerTransport } from "@rpgjs/server/node"import serverModule from "../server"const app = express()const httpServer = createServer(app)const wsServer = new WebSocketServer({ noServer: true })const transport = createRpgServerTransport(serverModule)const currentDir = dirname(fileURLToPath(import.meta.url))const clientDistDir = resolve(currentDir, "../client")const clientIndexFile = join(clientDistDir, "index.html")app.use("/parties", async (req, res, next) => { await transport.handleNodeRequest(req, res, next, { mountedPath: "/parties", })})app.use(express.static(clientDistDir))app.get(/.*/, (_req, res) => { res.sendFile(clientIndexFile)})httpServer.on("upgrade", (request, socket, head) => { void transport.handleUpgrade(wsServer, request, socket, head)})httpServer.listen(3000)
This adapter is responsible for:
serving the built client from dist/client
forwarding HTTP requests under /parties
forwarding WebSocket upgrades to the RPGJS transport
dist/client: browser assets containing client and explicitly shared modules
dist/server/server.js: built version of your agnostic src/server.ts
dist/server/express.js: built version of your Express adapter
The MMORPG client build does not include modules imported only by
src/server.ts. Conversely, client-only modules and components are not part of
the server entry. Files imported by both entry graphs are shared code and may be
present in both outputs.
Do not import a server module, a server adapter, or a combined module index from
the client entry graph. Any file reachable from browser code can be included in
dist/client. Keep secrets in the deployment environment, never in source code
that a browser build can reach.
Keep source maps server-side
Map assets follow the same entry boundary as modules. In MMORPG mode, install the
server side of a map provider in src/server.ts; its compiler reads the complete
map and streams only nearby render and prediction chunks. The client side applies
those chunks but does not fetch the source document.For Tiled, expose image files through tiledMapFolderPlugin() and omit .tmx and
.tsx from allowedExtensions. Event definitions, object properties, collision
rules and the raw tile layer stay in the map room. The same provider module works
with a Node.js transport or a Cloudflare Durable Object.Start the built Express server with:
node dist/server/express.js
Development flow
During development, Vite still uses the server module you pass to rpgjs({ server }).That means:
src/server.ts stays the single source of truth for your game server
your adapter files are only needed when you want a specific production host
you do not need a separate server-dev.ts
Add another host later
To support another runtime, keep src/server.ts unchanged and add another adapter file:
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"RPGJS","colors":{"primary":"#1f7aec","light":"#59a5ff","dark":"#1559ac"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"newbot","hasAudioNarration":false,"actualSubdomain":"newbot","customDomains":["v5.rpgjs.dev"],"gitSource":{"type":"github","owner":"rsamaium","repo":"rpg-js","deployBranch":"v5","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b07ff003255825ab8495d59","clientVersion":"0.0.4336","searchFilterCounts":[{"language":"default","tag":"Guide","count":72},{"language":"default","tag":"API","count":32},{"language":"default","tag":"Gameplay","count":19},{"language":"default","tag":"Player API","count":16},{"language":"default","tag":"GUI","count":15},{"language":"default","tag":"Maps \u0026 World","count":14},{"language":"default","tag":"Advanced","count":11},{"language":"default","tag":"Hooks","count":9},{"language":"default","tag":"Quick Start","count":8},{"language":"default","tag":"Components","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"advanced/mmorpg-entries","slug":"/advanced/mmorpg-entries","pageMetadata":{"title":"MMORPG entries","description":"Organize client, server, and adapter entry points for an MMORPG project, with an Express example.","href":"/advanced/mmorpg-entries"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Organize client, server, and adapter entry points for an MMORPG project, with an Express example.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`1`,id:`mmorpg-entries`,children:`MMORPG entries`}),`\n`,_jsxs(_components.p,{children:[`When `,_jsx(_components.code,{children:`RPG_TYPE=mmorpg`}),`, RPGJS now treats your project as a multi-entry application:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`a browser client`}),`\n`,_jsx(_components.li,{children:`a framework-agnostic server module`}),`\n`,_jsx(_components.li,{children:`optional hosting adapters such as Express`}),`\n`]}),`\n`,_jsx(_components.p,{children:`Use this layout when you want to keep your game server portable across:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Vite development`}),`\n`,_jsx(_components.li,{children:`Express in production`}),`\n`,_jsx(_components.li,{children:`another Node host such as Fastify or Hono`}),`\n`,_jsx(_components.li,{children:`a custom deployment target later`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`RPG_TYPE`}),` defaults to `,_jsx(_components.code,{children:`rpg`}),` when it is not set. If this is your first online\ndeployment, start with `,_jsx(_components.a,{href:`/guide/deploy-mmorpg`,children:`Put an MMORPG online`}),`, which covers\nlocal verification, map publication, Node/Docker, and Cloudflare.`]}),`\n`,_jsx(Heading,{level:`2`,id:`recommended-structure`,children:`Recommended structure`}),`\n`,_jsxs(_components.p,{children:[`Keep your game logic in `,_jsx(_components.code,{children:`src/server.ts`}),`, and put host-specific bootstraps in `,_jsx(_components.code,{children:`src/entries`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`src/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` client.ts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` server.ts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` standalone.ts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` entries/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` express.ts`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Role of each file:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`src/client.ts`}),`: browser entry for `,_jsx(_components.code,{children:`mmorpg`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`src/server.ts`}),`: RPGJS server module, without `,_jsx(_components.code,{children:`express()`}),`, `,_jsx(_components.code,{children:`listen()`}),`, or platform code`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`src/entries/express.ts`}),`: Node entry that mounts `,_jsx(_components.code,{children:`src/server.ts`}),` in Express`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`src/standalone.ts`}),`: browser entry for `,_jsx(_components.code,{children:`RPG_TYPE=rpg`})]}),`\n`]}),`\n`,_jsxs(Heading,{level:`2`,id:`configure-rpgjs`,children:[`Configure `,_jsx(_components.code,{children:`rpgjs()`})]}),`\n`,_jsx(_components.p,{children:`Declare the MMORPG entries explicitly in your Vite config.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`30`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`30`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`defineConfig`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"vite\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`rpgjs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`tiledMapFolderPlugin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@rpgjs/vite\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` vue`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@vitejs/plugin-vue\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` serverModule`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"./src/server\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` default`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` defineConfig`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` plugins:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` vue`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` tiledMapFolderPlugin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` sourceFolder:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"./src/tiled\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` publicPath:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"/map\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` buildOutputPath:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"assets/data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Keep authoritative Tiled sources out of the browser build.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` allowedExtensions:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\".png\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\".jpg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\".jpeg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\".gif\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\".webp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\".svg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ...`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`rpgjs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` server:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` serverModule`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` entryPoints:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` rpg:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"./src/standalone.ts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` mmorpg:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"./src/client.ts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` server:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"./src/server.ts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` adapters:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` express:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"./src/entries/express.ts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`]})})}),`\n`,_jsxs(Heading,{level:`2`,id:`keep-src/server-ts-agnostic`,children:[`Keep `,_jsx(_components.code,{children:`src/server.ts`}),` agnostic`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`src/server.ts`}),` should export your RPGJS server module and nothing else.`]}),`\n`,_jsx(_components.p,{children:`It should not:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`create an HTTP server`}),`\n`,_jsxs(_components.li,{children:[`call `,_jsx(_components.code,{children:`listen()`})]}),`\n`,_jsx(_components.li,{children:`import Express directly`}),`\n`,_jsx(_components.li,{children:`depend on a specific host runtime`}),`\n`]}),`\n`,_jsx(_components.p,{children:`Example:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`createServer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`provideServerModules`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@rpgjs/server\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` mainServerModule`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"./modules/server\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` default`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` createServer`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` providers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` provideServerModules`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`mainServerModule`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`This file is the canonical server entry for your game. Vite development can use it directly, and production adapters can import it without duplicating game setup.`}),`\n`,_jsx(Heading,{level:`2`,id:`express-adapter-example`,children:`Express adapter example`}),`\n`,_jsxs(_components.p,{children:[`Put your Express bootstrap in `,_jsx(_components.code,{children:`src/entries/express.ts`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`33`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`33`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` express`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"express\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`createServer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"node:http\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`dirname`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`join`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resolve`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"node:path\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`fileURLToPath`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"node:url\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`WebSocketServer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"ws\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`createRpgServerTransport`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@rpgjs/server/node\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` serverModule`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"../server\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` app`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` express`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` httpServer`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` createServer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` wsServer`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` WebSocketServer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`noServer:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` transport`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` createRpgServerTransport`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`serverModule`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` currentDir`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` dirname`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`fileURLToPath`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:`meta`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`url`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` clientDistDir`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` resolve`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`currentDir`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"../client\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` clientIndexFile`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` join`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`clientDistDir`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"index.html\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`use`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/parties\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`next`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` transport`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`handleNodeRequest`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`next`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` mountedPath:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"/parties\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`use`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`express`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`static`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`clientDistDir`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`get`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:`/`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D16969`},children:`.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`*`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:`/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`_req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`sendFile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`clientIndexFile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`httpServer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`on`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"upgrade\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`socket`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`head`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` transport`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`handleUpgrade`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wsServer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`socket`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`head`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`httpServer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`listen`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`This adapter is responsible for:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`serving the built client from `,_jsx(_components.code,{children:`dist/client`})]}),`\n`,_jsxs(_components.li,{children:[`forwarding HTTP requests under `,_jsx(_components.code,{children:`/parties`})]}),`\n`,_jsx(_components.li,{children:`forwarding WebSocket upgrades to the RPGJS transport`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`build-output`,children:`Build output`}),`\n`,_jsx(_components.p,{children:`Run the MMORPG build with:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`RPG_TYPE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`mmorpg`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` vite`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` build`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`RPGJS produces two output folders:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`dist/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` client/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` index.html`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` assets/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` server/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` server.js`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` express.js`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Meaning of each output:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`dist/client`}),`: browser assets containing client and explicitly shared modules`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`dist/server/server.js`}),`: built version of your agnostic `,_jsx(_components.code,{children:`src/server.ts`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`dist/server/express.js`}),`: built version of your Express adapter`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The MMORPG client build does not include modules imported only by\n`,_jsx(_components.code,{children:`src/server.ts`}),`. Conversely, client-only modules and components are not part of\nthe server entry. Files imported by both entry graphs are shared code and may be\npresent in both outputs.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Do not import a server module, a server adapter, or a combined module index from\nthe client entry graph. Any file reachable from browser code can be included in\n`,_jsx(_components.code,{children:`dist/client`}),`. Keep secrets in the deployment environment, never in source code\nthat a browser build can reach.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`keep-source-maps-server-side`,children:`Keep source maps server-side`}),`\n`,_jsxs(_components.p,{children:[`Map assets follow the same entry boundary as modules. In MMORPG mode, install the\nserver side of a map provider in `,_jsx(_components.code,{children:`src/server.ts`}),`; its compiler reads the complete\nmap and streams only nearby render and prediction chunks. The client side applies\nthose chunks but does not fetch the source document.`]}),`\n`,_jsxs(_components.p,{children:[`For Tiled, expose image files through `,_jsx(_components.code,{children:`tiledMapFolderPlugin()`}),` and omit `,_jsx(_components.code,{children:`.tmx`}),` and\n`,_jsx(_components.code,{children:`.tsx`}),` from `,_jsx(_components.code,{children:`allowedExtensions`}),`. Event definitions, object properties, collision\nrules and the raw tile layer stay in the map room. The same provider module works\nwith a Node.js transport or a Cloudflare Durable Object.`]}),`\n`,_jsx(_components.p,{children:`Start the built Express server with:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`node`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` dist/server/express.js`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`development-flow`,children:`Development flow`}),`\n`,_jsxs(_components.p,{children:[`During development, Vite still uses the server module you pass to `,_jsx(_components.code,{children:`rpgjs({ server })`}),`.`]}),`\n`,_jsx(_components.p,{children:`That means:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`src/server.ts`}),` stays the single source of truth for your game server`]}),`\n`,_jsx(_components.li,{children:`your adapter files are only needed when you want a specific production host`}),`\n`,_jsxs(_components.li,{children:[`you do not need a separate `,_jsx(_components.code,{children:`server-dev.ts`})]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`add-another-host-later`,children:`Add another host later`}),`\n`,_jsxs(_components.p,{children:[`To support another runtime, keep `,_jsx(_components.code,{children:`src/server.ts`}),` unchanged and add another adapter file:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`src/entries/fastify.ts`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`src/entries/hono.ts`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`src/entries/custom.ts`})}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Then declare it in `,_jsx(_components.code,{children:`entryPoints.mmorpg.adapters`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:`mmorpg`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./src/client.ts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` server`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./src/server.ts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` adapters`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` express`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./src/entries/express.ts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` fastify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./src/entries/fastify.ts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The build will emit one file per adapter in `,_jsx(_components.code,{children:`dist/server`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`related-pages`,children:`Related pages`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`For the complete beginner deployment path, see `,_jsx(_components.a,{href:`/guide/deploy-mmorpg`,children:`/guide/deploy-mmorpg`})]}),`\n`,_jsxs(_components.li,{children:[`For the Node transport API and protected map updates, see `,_jsx(_components.a,{href:`/advanced/node-server-production`,children:`/advanced/node-server-production`})]}),`\n`,_jsxs(_components.li,{children:[`For a Cloudflare Durable Object deployment, see `,_jsx(_components.a,{href:`/advanced/cloudflare-server-production`,children:`/advanced/cloudflare-server-production`})]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"MMORPG entries","description":"Organize client, server, and adapter entry points for an MMORPG project, with an Express example.","href":"/advanced/mmorpg-entries"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"MMORPG entries","slug":"mmorpg-entries","depth":1,"children":[]},{"title":"Recommended structure","slug":"recommended-structure","depth":2,"children":[]},{"title":"Configure rpgjs()","slug":"configure-rpgjs","depth":2,"children":[]},{"title":"Keep src/server.ts agnostic","slug":"keep-src/server-ts-agnostic","depth":2,"children":[]},{"title":"Express adapter example","slug":"express-adapter-example","depth":2,"children":[]},{"title":"Build output","slug":"build-output","depth":2,"children":[{"title":"Keep source maps server-side","slug":"keep-source-maps-server-side","depth":3,"children":[]}]},{"title":"Development flow","slug":"development-flow","depth":2,"children":[]},{"title":"Add another host later","slug":"add-another-host-later","depth":2,"children":[]},{"title":"Related pages","slug":"related-pages","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"newbot","siteName":"RPGJS","title":"MMORPG entries - RPGJS","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-22T13:39:49.567Z","originalFileLocation":"advanced/mmorpg-entries.md"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Organize client, server, and adapter entry points for an MMORPG project, with an Express example.\">\u003cmeta data-mint-head name=\"application-name\" content=\"RPGJS\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/newbot/_generated/favicon/apple-touch-icon.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/newbot/_generated/favicon/favicon-32x32.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/newbot/_generated/favicon/favicon-16x16.png?v=3\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/newbot/_generated/favicon/favicon.ico?v=3\">\u003cmeta data-mint-head property=\"og:title\" content=\"MMORPG entries - RPGJS\">\u003cmeta data-mint-head property=\"og:description\" content=\"Organize client, server, and adapter entry points for an MMORPG project, with an Express example.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"RPGJS\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://v5.rpgjs.dev/advanced/mmorpg-entries\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://newbot.mintlify.site/_mintlify/api/og/v2?division=Advanced\u0026amp;title=MMORPG+entries\u0026amp;description=Organize+client%2C+server%2C+and+adapter+entry+points+for+an+MMORPG+project%2C+with+an+Express+example.\u0026amp;theme=3dd04698c9410ad357c55b0e\u0026amp;signature=91f5eb4836f5a2a35cfae59f3ac9bddfb7ba0086d967f9a354ac3640d1134616\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"MMORPG entries - RPGJS\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Organize client, server, and adapter entry points for an MMORPG project, with an Express example.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://newbot.mintlify.site/_mintlify/api/og/v2?division=Advanced\u0026amp;title=MMORPG+entries\u0026amp;description=Organize+client%2C+server%2C+and+adapter+entry+points+for+an+MMORPG+project%2C+with+an+Express+example.\u0026amp;theme=3dd04698c9410ad357c55b0e\u0026amp;signature=91f5eb4836f5a2a35cfae59f3ac9bddfb7ba0086d967f9a354ac3640d1134616\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/newbot/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"RPGJS\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1f7aec\">\u003clink data-mint-head rel=\"canonical\" href=\"https://v5.rpgjs.dev/advanced/mmorpg-entries\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/advanced/mmorpg-entries.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://v5.rpgjs.dev/#organization\",\"name\":\"RPGJS\",\"url\":\"https://v5.rpgjs.dev\"},{\"@type\":\"WebSite\",\"@id\":\"https://v5.rpgjs.dev#website\",\"name\":\"RPGJS\",\"url\":\"https://v5.rpgjs.dev\",\"publisher\":{\"@id\":\"https://v5.rpgjs.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://v5.rpgjs.dev/advanced/mmorpg-entries#webpage\",\"url\":\"https://v5.rpgjs.dev/advanced/mmorpg-entries\",\"name\":\"MMORPG entries\",\"description\":\"Organize client, server, and adapter entry points for an MMORPG project, with an Express example.\",\"dateModified\":\"2026-07-22T13:39:49.567Z\",\"isPartOf\":{\"@id\":\"https://v5.rpgjs.dev#website\"},\"breadcrumb\":{\"@id\":\"https://v5.rpgjs.dev/advanced/mmorpg-entries#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://v5.rpgjs.dev/advanced/mmorpg-entries#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Advanced\",\"item\":\"https://v5.rpgjs.dev/philosophy\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MMORPG entries\",\"item\":\"https://v5.rpgjs.dev/advanced/mmorpg-entries\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://v5.rpgjs.dev/advanced/mmorpg-entries#article\",\"headline\":\"MMORPG entries\",\"name\":\"MMORPG entries\",\"description\":\"Organize client, server, and adapter entry points for an MMORPG project, with an Express example.\",\"url\":\"https://v5.rpgjs.dev/advanced/mmorpg-entries\",\"mainEntityOfPage\":{\"@id\":\"https://v5.rpgjs.dev/advanced/mmorpg-entries#webpage\"},\"dateModified\":\"2026-07-22T13:39:49.567Z\",\"publisher\":{\"@id\":\"https://v5.rpgjs.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://v5.rpgjs.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"RPGJS\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"RPGJS\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/advanced/mmorpg-entries.md","siteName":"RPGJS","nav":{"global":null,"tabs":[{"tab":"Guide","groups":[{"group":"Quick Start","root":{"title":"Quick Start","href":""},"pages":[{"title":"Quick Start","href":"/index"},{"title":"Quick Start","href":"/guide/quick-start"},{"title":"Getting Started","href":"/guide/get-started"},{"title":"Structure","href":"/guide/structure"},{"title":"Create your first map","href":"/guide/create-your-first-map"},{"title":"Create hero in map","href":"/guide/create-hero-in-map"},{"title":"Create spritesheet","href":"/guide/create-spritesheet"},{"title":"Put an MMORPG online","href":"/guide/deploy-mmorpg"}]},{"group":"Maps \u0026 World","pages":[{"title":"Using TiledMap with RPG-JS","href":"/tiled/index"},{"title":"Create a world","href":"/guide/create-world"},{"title":"World Maps API","href":"/guide/world-maps"},{"title":"provideLoadMap","href":"/advanced/provide-load-map"},{"title":"Create Shape","href":"/guide/create-shape"},{"title":"Display Animations","href":"/guide/display-animations"},{"title":"Emotion Bubbles","href":"/guide/emotion-bubble"},{"title":"Client Visuals","href":"/guide/client-visuals"},{"title":"Hide Map Objects","href":"/guide/hide-map-objects"},{"title":"Client interactions","href":"/guide/interactions"},{"title":"Spritesheets Guide","href":"/guide/spritesheets"},{"title":"Lighting","href":"/guide/lighting"},{"title":"Time Manager","href":"/guide/time-manager"},{"title":"Weather","href":"/guide/weather"}]},{"group":"Components","pages":[{"title":"Components overview","href":"/guide/components-overview"},{"title":"Sprite Components Guide","href":"/guide/sprite-components"},{"title":"Authoritative Sprite Components","href":"/guide/component"},{"title":"Prebuilt Components","href":"/guide/prebuilt-components/index"},{"title":"Light Halo Component","href":"/guide/prebuilt-components/light-halo"}]},{"group":"Gameplay","pages":[{"title":"Create an event","href":"/guide/create-event"},{"title":"Event Modes: Shared vs Scenario","href":"/guide/event-modes"},{"title":"Event Touch and Map Variables","href":"/guide/event-touch-map-variables"},{"title":"Movement System Guide","href":"/guide/create-movement"},{"title":"Projectiles","href":"/guide/projectiles"},{"title":"Move Routes","href":"/guide/move-routes"},{"title":"Create database","href":"/guide/create-database"},{"title":"Scripts","href":"/guide/scripts"},{"title":"Items System","href":"/guide/items"},{"title":"Loot","href":"/guide/loot"},{"title":"Skill and item hotbar","href":"/guide/hotbar"},{"title":"Save and load player data","href":"/guide/save-load"},{"title":"Internationalization","href":"/guide/i18n"},{"title":"Synchronization between Server and Client","href":"/guide/synchronization"},{"title":"Action Battle System","href":"/guide/battle-ai"},{"title":"Create sounds","href":"/guide/create-sounds"},{"title":"Sounds Guide","href":"/guide/sounds"},{"title":"Testing with @rpgjs/testing","href":"/guide/testing"},{"title":"Creating Modules in RPGJS","href":"/guide/create-module"}]},{"group":"GUI","pages":[{"title":"GUI overview","href":"/gui/index"},{"title":"Customize GUI themes","href":"/gui/theming"},{"title":"Title Screen","href":"/gui/title-screen"},{"title":"MMORPG Account","href":"/gui/account"},{"title":"Character Select","href":"/gui/character-select"},{"title":"Dialog Box","href":"/gui/dialog-box"},{"title":"HUD","href":"/gui/hud"},{"title":null,"href":"/gui/mobile"},{"title":"Prebuilt GUI Contracts","href":"/gui/prebuilt-contracts"},{"title":"Chat module","href":"/gui/chat"},{"title":"Calendar module","href":"/gui/calendar"},{"title":"Attach GUI to Sprites Guide","href":"/guide/gui/attach-gui"},{"title":"Engine Injection in .ce Files","href":"/gui/engine-injection"},{"title":"Optimistic GUI Actions","href":"/gui/optimistic-actions"},{"title":"Vue.js 3 Integration with RPGJS GUI System","href":"/gui/vue-integration"}]},{"group":"Advanced","pages":[{"title":"Framework Philosophy","href":"/philosophy"},{"title":"Roadmap","href":"/roadmap"},{"title":"Migrate from v4 to v5","href":"/migration/v4-to-v5"},{"title":"Custom Gameplay Rooms","href":"/advanced/custom-gameplay-rooms"},{"title":"Advanced Signe Extension Points","description":"Understand when direct Signe APIs are appropriate in an RPGJS plugin.","href":"/advanced/signe-extension-points"},{"title":"MMORPG entries","href":"/advanced/mmorpg-entries"},{"title":"Node server in production","description":"Run RPGJS without Vite in production, secure map updates, and mount the transport in a Node HTTP server.","href":"/advanced/node-server-production"},{"title":"Cloudflare server in production","href":"/advanced/cloudflare-server-production"},{"title":"Latency Simulation","href":"/advanced/latency-simulation"},{"title":"Packet Loss Simulation","href":"/advanced/packet-loss-simulation"},{"title":"Smooth Movement of Other Players","href":"/advanced/remote-smoothing"}]}]},{"tab":"API","pages":[{"title":"API","href":"/api"}]},{"tab":"Studio","pages":[{"title":"Studio","href":"/studio"}]}]},"basePath":"","title":"MMORPG entries - RPGJS","deploymentId":"dpl_9bQLTw9nc2h9csDGYcKwWenPcQWn","buildId":"dpl_9bQLTw9nc2h9csDGYcKwWenPcQWn","dynamics":[],"chunks":[]}