feat: Initial commit of PDF Tools project

This commit is contained in:
2025-08-25 02:29:48 +08:00
parent af6827cd9e
commit 30180e50a2
48 changed files with 36364 additions and 1 deletions

35
server/healthcheck.js Normal file
View File

@@ -0,0 +1,35 @@
#!/usr/bin/env node
const http = require('http');
const process = require('process');
const options = {
hostname: 'localhost',
port: process.env.PORT || 3001,
path: '/health',
method: 'GET',
timeout: 3000,
};
const healthCheck = http.request(options, (res) => {
console.log(`Health check status: ${res.statusCode}`);
if (res.statusCode === 200) {
process.exit(0);
} else {
process.exit(1);
}
});
healthCheck.on('error', (err) => {
console.error('Health check failed:', err.message);
process.exit(1);
});
healthCheck.on('timeout', () => {
console.error('Health check timeout');
healthCheck.destroy();
process.exit(1);
});
healthCheck.end();