-
Notifications
You must be signed in to change notification settings - Fork 14
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
Showing
4 changed files
with
34 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const axios = require('axios'); | ||
const env = require('@next/env'); | ||
|
||
env.loadEnvConfig(process.cwd()); | ||
|
||
const apiBaseUrl = process.env.NEXT_PUBLIC_API_2_1_BASE_URL; | ||
const apiHandshakeEnabled = process.env.API_HANDSHAKE_ENABLED ?? true; | ||
|
||
const errorMessage = | ||
`*************************** | ||
APPLICATION FAILED TO START | ||
*************************** | ||
Description: | ||
Could not connect to the API server. | ||
Action: | ||
Start the UH Groupings API first | ||
or check the connection configuration and | ||
fix any possible problems.\n`; | ||
|
||
if (apiHandshakeEnabled) { | ||
axios.get(`${apiBaseUrl}/`) | ||
.catch(() => { | ||
console.log(errorMessage); | ||
process.exit(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