feat: show commit hash in footer and implement auto server health check for AppWPP

This commit is contained in:
2026-10-15 14:41:15 -03:00
parent d3b7dcbc1e
commit d8500cf433
4 changed files with 154 additions and 7 deletions
+17 -1
View File
@@ -1,9 +1,25 @@
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { execSync } from 'child_process'
let commitHash = process.env.COMMIT_REF
? process.env.COMMIT_REF.slice(0, 7)
: '';
if (!commitHash) {
try {
commitHash = execSync('git rev-parse --short HEAD').toString().trim();
} catch (e) {
commitHash = 'dev';
}
}
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
define: {
__COMMIT_HASH__: JSON.stringify(commitHash)
},
server: {
proxy: {
'/api-wpp': {