home/categories/backend/trpc-trpc-packages-server-skills-adapter-standalone-skill-md
backenddevelopment

adapter-standalone

Mount tRPC on Node.js built-in HTTP server with createHTTPServer() from @trpc/server/adapters/standalone, createHTTPHandler() for custom http.createServer, createHTTP2Handler() for HTTP/2 with TLS. Configure basePath to slice URL prefix, CORS via the cors npm package passed as middleware option. CreateHTTPContextOptions provides req and res for context creation.

trpc
maintainer
trpc
更新於 28/3/2026
星標
39965
分支
1571
quick start

Installation and usage

Mount tRPC on Node.js built-in HTTP server with createHTTPServer() from @trpc/server/adapters/standalone, createHTTPHandler() for custom http.createServer, createHTTP2Handler() for HTTP/2 with TLS. Configure basePath to slice URL prefix, CORS via the cors npm package passed as middleware option. CreateHTTPContextOptions provides req and res for context creation.

安裝
$ install --globalskills.sh
使用

安裝後,您可以通過在終端運行以下命令來使用此技能:

skills use adapter-standalone