-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e73730
commit 046ecdc
Showing
4 changed files
with
9 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import portfinder from 'portfinder' | ||
import * as http from 'http' | ||
import { delay } from './utils' | ||
import app from '../../src/app' | ||
|
||
let server: http.Server | ||
|
||
export const startServer = async () => { | ||
await delay(1000) | ||
const port = await portfinder.getPortPromise({ port: 4001 }) | ||
const port = 4001 | ||
server = app.listen(port) | ||
return port | ||
} | ||
|
||
export const stopServer = async () => { | ||
export const stopServer = () => { | ||
server?.close() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters