MCPcopy Index your code
hub / github.com/coder/code-server / common

Function common

src/node/routes/index.ts:66–83  ·  view source on GitHub ↗
(req, _, next)

Source from the content-addressed store, hash-verified

64 const cookieSessionName = getCookieSessionName(args["cookie-suffix"])
65
66 const common: express.RequestHandler = (req, _, next) => {
67 // /healthz|/healthz/ needs to be excluded otherwise health checks will make
68 // it look like code-server is always in use.
69 if (!/^\/healthz\/?$/.test(req.url)) {
70 // NOTE@jsjoeio - intentionally not awaiting the .beat() call here because
71 // we don't want to slow down the request.
72 heart.beat()
73 }
74
75 // Add common variables routes can use.
76 req.args = args
77 req.heart = heart
78 req.settings = settings
79 req.updater = updater
80 req.cookieSessionName = cookieSessionName
81
82 next()
83 }
84
85 app.router.use(common)
86 app.wsRouter.use(common)

Callers

nothing calls this directly

Calls 1

beatMethod · 0.80

Tested by

no test coverage detected