-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
136 lines (129 loc) · 3.68 KB
/
Copy pathserver.js
File metadata and controls
136 lines (129 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;
app.get('/', (req, res) => {
res.send(`
<!DOCTYPE html>
<html>
<head>
<title>QuikDB Test Deploy</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
margin: 0;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.container {
background: white;
padding: 3rem;
border-radius: 1rem;
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
text-align: center;
max-width: 500px;
}
h1 {
color: #667eea;
margin: 0 0 1rem 0;
}
p {
color: #666;
line-height: 1.6;
}
.badge {
display: inline-block;
background: #10b981;
color: white;
padding: 0.5rem 1rem;
border-radius: 2rem;
font-size: 0.875rem;
font-weight: 600;
margin-top: 1rem;
}
.info {
margin-top: 2rem;
padding-top: 2rem;
border-top: 1px solid #e5e7eb;
}
.info-item {
display: flex;
justify-content: space-between;
padding: 0.5rem 0;
font-size: 0.875rem;
}
.info-label {
color: #9ca3af;
}
.info-value {
color: #374151;
font-weight: 600;
}
</style>
</head>
<body>
<div class="container">
<h1>🚀 QuikDB Compute</h1>
<p>Your test application is successfully deployed and running!</p>
<div class="badge">✓ Deployment Successful</div>
<div class="info">
<div class="info-item">
<span class="info-label">Port</span>
<span class="info-value">${PORT}</span>
</div>
<div class="info-item">
<span class="info-label">Node Version</span>
<span class="info-value">${process.version}</span>
</div>
<div class="info-item">
<span class="info-label">Status</span>
<span class="info-value">Running</span>
</div>
</div>
</div>
</body>
</html>
`);
});
app.get('/health', (req, res) => {
res.json({
status: 'healthy',
timestamp: new Date().toISOString(),
uptime: process.uptime(),
port: PORT
});
});
app.get('/api/info', (req, res) => {
res.json({
name: 'test-deploy-quik',
version: '1.0.0',
environment: process.env.NODE_ENV || 'development',
nodeVersion: process.version,
platform: process.platform,
memory: process.memoryUsage()
});
});
app.listen(PORT, () => {
console.log(`✅ Server running on port ${PORT}`);
console.log(`🌐 Visit http://localhost:${PORT}`);
});
// Continuous logging for testing log streaming
let logCounter = 0;
setInterval(() => {
logCounter++;
const logLevels = ['info', 'warn', 'error', 'debug'];
const level = logLevels[logCounter % 4];
console.log(JSON.stringify({
timestamp: new Date().toISOString(),
level: level,
message: `Test log message #${logCounter} - ${level.toUpperCase()}`,
metadata: {
counter: logCounter,
uptime: Math.floor(process.uptime()),
memoryUsedMB: Math.floor(process.memoryUsage().heapUsed / 1024 / 1024),
type: 'interval_log'
}
}));
}, 1000);