Skip to content

Commit ca923f7

Browse files
committed
commitID
1 parent 37c2688 commit ca923f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

server/app.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ const __dirname = dirname(__filename)
5959
const port = 8085
6060
const app: Application = express()
6161

62+
// Commit ID variable (declared here to avoid TDZ issues)
63+
let commitId = ''
64+
6265
// Initialize Redis client.
6366
console.log(`--- Redis setup -------------------------------------------------`)
6467
process.env.VITE_OBP_REDIS_URL
@@ -189,7 +192,7 @@ let instance: any
189192
// Try to get the commit ID
190193
commitId = execSync('git rev-parse HEAD', { encoding: 'utf-8' }).trim()
191194
console.log('Current Commit ID:', commitId)
192-
} catch (error) {
195+
} catch (error: any) {
193196
// Log the error but do not terminate the process
194197
console.error('Warning: Failed to retrieve the commit ID. Proceeding without it.')
195198
console.error('Error details:', error.message)
@@ -212,9 +215,6 @@ let instance: any
212215
})()
213216

214217
// Export instance for use in other modules
215-
export { instance }
216-
217-
// Commit ID variable
218-
export let commitId = ''
218+
export { instance, commitId }
219219

220220
export default app

0 commit comments

Comments
 (0)