@@ -217,7 +217,8 @@ export function createApp(): express.Application {
217217 res . header ( "Access-Control-Allow-Headers" , "Content-Type" ) ;
218218 res . header ( "Access-Control-Allow-Methods" , "GET, POST, OPTIONS" ) ;
219219 if ( req . method === "OPTIONS" ) {
220- return res . sendStatus ( 200 ) ;
220+ res . sendStatus ( 200 ) ;
221+ return ;
221222 }
222223 next ( ) ;
223224 } ) ;
@@ -228,17 +229,19 @@ export function createApp(): express.Application {
228229 } ) ;
229230
230231 // Start analysis
231- app . post ( "/api/analyze" , async ( req : Request , res : Response ) => {
232+ app . post ( "/api/analyze" , async ( req : Request , res : Response ) : Promise < void > => {
232233 const { repoUrl, options = { } } = req . body ;
233234
234235 if ( ! repoUrl ) {
235- return res . status ( 400 ) . json ( { error : "repoUrl is required" } ) ;
236+ res . status ( 400 ) . json ( { error : "repoUrl is required" } ) ;
237+ return ;
236238 }
237239
238240 try {
239241 parseGitHubUrl ( repoUrl ) ; // Validate URL
240242 } catch ( error : any ) {
241- return res . status ( 400 ) . json ( { error : error . message } ) ;
243+ res . status ( 400 ) . json ( { error : error . message } ) ;
244+ return ;
242245 }
243246
244247 const job : AnalysisJob = {
@@ -258,11 +261,12 @@ export function createApp(): express.Application {
258261 } ) ;
259262
260263 // SSE endpoint for progress
261- app . get ( "/api/jobs/:jobId/stream" , ( req : Request , res : Response ) => {
264+ app . get ( "/api/jobs/:jobId/stream" , ( req : Request , res : Response ) : void => {
262265 const jobId = req . params . jobId as string ;
263266 const job = jobs . get ( jobId ) ;
264267 if ( ! job ) {
265- return res . status ( 404 ) . json ( { error : "Job not found" } ) ;
268+ res . status ( 404 ) . json ( { error : "Job not found" } ) ;
269+ return ;
266270 }
267271
268272 res . setHeader ( "Content-Type" , "text/event-stream" ) ;
@@ -295,11 +299,12 @@ export function createApp(): express.Application {
295299 } ) ;
296300
297301 // Get job status
298- app . get ( "/api/jobs/:jobId" , ( req : Request , res : Response ) => {
302+ app . get ( "/api/jobs/:jobId" , ( req : Request , res : Response ) : void => {
299303 const jobId = req . params . jobId as string ;
300304 const job = jobs . get ( jobId ) ;
301305 if ( ! job ) {
302- return res . status ( 404 ) . json ( { error : "Job not found" } ) ;
306+ res . status ( 404 ) . json ( { error : "Job not found" } ) ;
307+ return ;
303308 }
304309
305310 res . json ( {
@@ -311,16 +316,18 @@ export function createApp(): express.Application {
311316 } ) ;
312317
313318 // Get generated file content
314- app . get ( "/api/jobs/:jobId/files/:filename" , async ( req : Request , res : Response ) => {
319+ app . get ( "/api/jobs/:jobId/files/:filename" , async ( req : Request , res : Response ) : Promise < void > => {
315320 const jobId = req . params . jobId as string ;
316321 const filename = req . params . filename as string ;
317322 const job = jobs . get ( jobId ) ;
318323 if ( ! job || ! job . result ) {
319- return res . status ( 404 ) . json ( { error : "Job or file not found" } ) ;
324+ res . status ( 404 ) . json ( { error : "Job or file not found" } ) ;
325+ return ;
320326 }
321327
322328 if ( ! job . result . files . includes ( filename ) ) {
323- return res . status ( 404 ) . json ( { error : "File not found" } ) ;
329+ res . status ( 404 ) . json ( { error : "File not found" } ) ;
330+ return ;
324331 }
325332
326333 try {
0 commit comments