MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / simpleLayoutHandler

Method simpleLayoutHandler

lib/handlers/route-api.ts:176–186  ·  view source on GitHub ↗
(req: express.Request, res: express.Response)

Source from the content-addressed store, hash-verified

174 }
175
176 simpleLayoutHandler(req: express.Request, res: express.Response) {
177 const state = new ClientState();
178 const session = state.findOrCreateSession(1);
179 session.language = unwrapString(req.query.lang);
180 session.source = unwrapString(req.query.code);
181 const compiler = session.findOrCreateCompiler(1);
182 compiler.id = unwrapString(req.query.compiler);
183 compiler.options = unwrapString(req.query.compiler_flags) || '';
184
185 this.renderClientState(state, null, req, res);
186 }
187
188 renderClientState(
189 clientstate: ClientState,

Callers

nothing calls this directly

Calls 4

findOrCreateSessionMethod · 0.95
renderClientStateMethod · 0.95
unwrapStringFunction · 0.50
findOrCreateCompilerMethod · 0.45

Tested by

no test coverage detected