-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: cleanup console logging and eslint disabling comments
- Loading branch information
Showing
5 changed files
with
24 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
#!/usr/bin/env node | ||
import { HOST, PORT } from './constants.js' | ||
import { logger } from './logger.js' | ||
|
||
const log = logger.forComponent('healthcheck') | ||
/** | ||
* This healthcheck script is used to check if the server is running and healthy. | ||
*/ | ||
const rootReq = await fetch(`http://${HOST}:${PORT}`, { method: 'GET' }) | ||
const status = rootReq.status | ||
// eslint-disable-next-line no-console | ||
console.log(`Healthcheck status: ${status}`) | ||
|
||
log(`Healthcheck status: ${status}`) | ||
process.exit(status === 200 ? 0 : 1) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { prefixLogger } from '@libp2p/logger' | ||
|
||
export const logger = prefixLogger('helia-http-gateway') |