mirror of
https://github.com/alexgo-io/stacks-blockchain-api.git
synced 2026-01-12 16:53:19 +08:00
fix: git-info error message
This commit is contained in:
11
src/index.ts
11
src/index.ts
@@ -84,6 +84,13 @@ function getConfiguredChainID() {
|
||||
}
|
||||
|
||||
async function init(): Promise<void> {
|
||||
if (isProdEnv && !fs.existsSync('.git-info')) {
|
||||
throw new Error(
|
||||
'File not found: .git-info. This generated file is required to display the running API version in the ' +
|
||||
'`/extended/v1/status` endpoint. Please execute `npm run build` to regenerate it.'
|
||||
);
|
||||
}
|
||||
|
||||
let db: DataStore;
|
||||
if ('STACKS_API_OFFLINE_MODE' in process.env) {
|
||||
db = OfflineDummyStore;
|
||||
@@ -162,10 +169,6 @@ async function init(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
if (isProdEnv && !fs.existsSync('.git-info')) {
|
||||
throw new Error(`Git info file not found`);
|
||||
}
|
||||
|
||||
const apiServer = await startApiServer({ datastore: db, chainId: getConfiguredChainID() });
|
||||
logger.info(`API server listening on: http://${apiServer.address}`);
|
||||
registerShutdownConfig({
|
||||
|
||||
Reference in New Issue
Block a user