MCPcopy
hub / github.com/transloadit/uppy / getServer

Function getServer

packages/@uppy/companion/test/mockserver.js:76–109  ·  view source on GitHub ↗
(extraEnv)

Source from the content-addressed store, hash-verified

74// todo rewrite companion to not use global state
75// https://github.com/transloadit/uppy/issues/3284
76export const getServer = async (extraEnv) => {
77 const { default: standalone } = await import('../src/standalone/index.js')
78
79 const env = {
80 ...defaultEnv,
81 ...extraEnv,
82 }
83
84 updateEnv(env)
85
86 const authServer = express()
87
88 authServer.use(
89 session({ secret: 'grant', resave: true, saveUninitialized: true }),
90 )
91 authServer.all('*/callback', (req, res, next) => {
92 // @ts-ignore
93 req.session.grant = {
94 response: { access_token: grantToken },
95 }
96 next()
97 })
98 authServer.all(['*/send-token', '*/redirect'], (req, res, next) => {
99 // @ts-ignore
100 req.session.grant = {
101 dynamic: { state: req.query.state || 'non-empty-value' },
102 }
103 next()
104 })
105
106 const { app } = standalone()
107 authServer.use(app)
108 return authServer
109}

Callers 12

getServerWithEnvFunction · 0.90
companion.test.jsFile · 0.90
runUrlMetaTestFunction · 0.90
runUrlGetTestFunction · 0.90
getZoomServerFunction · 0.90
callback.test.jsFile · 0.90
subpath.test.jsFile · 0.90
preauth.test.jsFile · 0.90
getServerWithEnvFunction · 0.90
getMockServerFunction · 0.90

Calls 2

updateEnvFunction · 0.85
useMethod · 0.80

Tested by 7

getServerWithEnvFunction · 0.72
runUrlMetaTestFunction · 0.72
runUrlGetTestFunction · 0.72
getZoomServerFunction · 0.72
getServerWithEnvFunction · 0.72
getMockServerFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…