-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Victor Diez <[email protected]>
- Loading branch information
Showing
6 changed files
with
103 additions
and
24 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
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
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
24 changes: 24 additions & 0 deletions
24
sonar-plugin/bridge/src/test/resources/package/bin/server.cjs
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env node | ||
|
||
const http = require('http'); | ||
const port = process.argv[2]; | ||
const host = process.argv[3]; | ||
|
||
const requestHandler = (request, response) => { | ||
if (request.url === '/status') { | ||
response.writeHead(200, { 'Content-Type': 'text/plain' }); | ||
response.end('OK!'); | ||
server.close(); | ||
} | ||
}; | ||
|
||
const server = http.createServer(requestHandler); | ||
server.keepAliveTimeout = 100; // this is used so server disconnects faster | ||
|
||
server.listen(port, host, err => { | ||
if (err) { | ||
return console.log('something bad happened', err); | ||
} | ||
|
||
console.log(`server is listening on ${host} ${port}`); | ||
}); |