MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / configureServer

Function configureServer

packages/playground/vite.plugin.server.ts:82–102  ·  view source on GitHub ↗
(devServer)

Source from the content-addressed store, hash-verified

80 return {
81 name: 'at-test-data-server',
82 configureServer(devServer) {
83 const testDataPath = path.join(__dirname, '..', 'alphatab', 'test-data');
84 const log: Logger = devServer.config.logger;
85
86 devServer.middlewares.use('/font', serveStatic(path.join(__dirname, '..', 'alphatab', 'font')));
87 devServer.middlewares.use('/test-data', serveStatic(testDataPath));
88
89 devServer.middlewares.use('/test-results/list', (_req, res) => {
90 try {
91 writeJson(res, 200, 'OK', crawlNewReferenceFiles(testDataPath));
92 } catch (e) {
93 writeError(res, 500, 'Internal Server Error', e as Error);
94 }
95 });
96
97 devServer.middlewares.use('/test-results/accept', (req, res) => {
98 handleAccept(req, res, testDataPath, log).catch(e => {
99 writeError(res, 500, 'Internal Server Error', e as Error);
100 });
101 });
102 }
103 };
104}
105

Callers

nothing calls this directly

Calls 5

writeJsonFunction · 0.85
crawlNewReferenceFilesFunction · 0.85
writeErrorFunction · 0.85
handleAcceptFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected