Skip to content

Commit

Permalink
Add debugger endpoint to express4-typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
watson committed Jan 13, 2025
1 parent ccffb0f commit 240903a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/build/docker/nodejs/express4-typescript/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const multer = require('multer')
const uploadToMemory = multer({ storage: multer.memoryStorage(), limits: { fileSize: 200000 } })

const iast = require('./iast')
const di = require('./debugger')

iast.initData().catch(() => {})

Expand All @@ -29,6 +30,8 @@ iast.initMiddlewares(app)
require('./auth')(app, passport, tracer)
iast.initRoutes(app)

di.initRoutes(app)

app.get('/', (req: Request, res: Response) => {
console.log('Received a request');
res.send('Hello\n');
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { Express } from 'express'
import { logHandler } from './log_handler'

export function initRoutes (app: Express) {
app.get('/log', logHandler)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { Request, Response } from 'express'

// Padding
// Padding
// Padding
// Padding
// Padding
// Padding
// Padding
// Padding
// Padding
// Padding
// Padding
// Padding
// Padding
// Padding
// Padding

export function logHandler (req: Request, res: Response) {
res.send('Log probe') // This needs to be line 20
}

0 comments on commit 240903a

Please sign in to comment.