-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
39 lines (30 loc) · 905 Bytes
/
app.js
File metadata and controls
39 lines (30 loc) · 905 Bytes
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
// app.js
const express = require('express');
const path = require('path');
const app = express();
const port = process.env.PORT || 3000;
// var unusedVariable = "This will cause a lint error"; // LINT ERROR: unused variable
// Serve static files
app.use(express.static('public'));
// Routes
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'index.html'));
});
app.get('/health', (req, res) => {
res.json({
status: 'healthy',
timestamp: new Date().toISOString(),
version: process.env.APP_VERSION || '1.0.0'
});
});
app.get('/api/info', (req, res) => {
res.json({
message: 'Hello from CI/CD Lab!',
environment: process.env.NODE_ENV || 'development',
version: process.env.APP_VERSION || '1.0.0'
});
});
app.listen(port, () => {
console.log(`Server running on port ${port}`);
});
module.exports = app;