-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathsimple-server.js
More file actions
41 lines (35 loc) · 958 Bytes
/
simple-server.js
File metadata and controls
41 lines (35 loc) · 958 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
40
41
const express = require('express');
const app = express();
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
// Basic health check endpoint
app.get('/', (req, res) => {
res.json({
message: 'TeachLink API is running',
timestamp: new Date().toISOString(),
status: 'OK'
});
});
// Basic API info endpoint
app.get('/api', (req, res) => {
res.json({
name: 'TeachLink API',
version: '1.0.0',
status: 'Running',
endpoints: ['/', '/api', '/health']
});
});
// Health check endpoint
app.get('/health', (req, res) => {
res.json({
status: 'healthy',
timestamp: new Date().toISOString(),
uptime: process.uptime()
});
});
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`🚀 Server is running on port ${PORT}`);
console.log(`📚 API available at http://localhost:${PORT}/api`);
console.log(`🏥 Health check at http://localhost:${PORT}/health`);
});