MCPcopy Create free account
hub / github.com/TanStack/router / createStartServer

Function createStartServer

e2e/solid-start/basic/server.js:30–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28}
29
30export async function createStartServer() {
31 const distServerEntryPath = resolveDistServerEntryPath()
32 const server = (await import(distServerEntryPath)).default
33 const nodeHandler = toNodeHandler(server.fetch)
34
35 const app = express()
36
37 // to keep testing uniform stop express from redirecting /posts to /posts/
38 // when serving pre-rendered pages
39 app.use(express.static(distClientDir, { redirect: !isPrerender }))
40
41 app.use(async (req, res, next) => {
42 try {
43 await nodeHandler(req, res)
44 } catch (error) {
45 next(error)
46 }
47 })
48
49 return { app }
50}
51
52export async function createSpaServer() {
53 const app = express()

Callers 1

server.jsFile · 0.70

Calls 2

nextFunction · 0.50

Tested by

no test coverage detected