-import * as express from 'express'
+import express, { Request, Response } from 'express'
import { Server } from 'http'
import { randomInt } from '@shared/core-utils'
+import { terminateServer } from './utils'
type BlocklistResponse = {
data: {
return new Promise<number>(res => {
const app = express()
- app.get('/blocklist', (req: express.Request, res: express.Response) => {
+ app.get('/blocklist', (req: Request, res: Response) => {
return res.json(this.body)
})
- const port = 42201 + randomInt(1, 100)
+ const port = 45000 + randomInt(1, 1000)
this.server = app.listen(port, () => res(port))
})
}
}
terminate () {
- if (this.server) this.server.close()
+ return terminateServer(this.server)
}
}