Skip to content

Commit

Permalink
SQNC-54: moving promBundle to the variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
n3op2 committed Dec 18, 2024
1 parent 9ce3724 commit db11d4c
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ const customCssToInject: string = `
.swagger-ui section.models { background-color: #f7f7f7; }
`
const promClient = promBundle({
includePath: true,
promClient: {
collectDefaultMetrics: {
prefix: 'sqnc_matchmaker_api_',
},
},
})

export default async (): Promise<Express> => {
const app: Express = express()
Expand All @@ -38,16 +46,7 @@ export default async (): Promise<Express> => {
app.use(bodyParser.urlencoded({ extended: true }))
app.use(bodyParser.json())
app.use(cors())
app.use(
promBundle({
includePath: true,
promClient: {
collectDefaultMetrics: {
prefix: 'sqnc_matchmaker_',
},
},
})
)
app.use(promClient)

app.use((req, _, next) => {
// make sure we always have a file object on req even if this is not a multipart
Expand Down

0 comments on commit db11d4c

Please sign in to comment.