-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
34 lines (29 loc) · 987 Bytes
/
server.js
File metadata and controls
34 lines (29 loc) · 987 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
const express = require('express');
const path = require('path');
const app = express();
const PORT = process.env.PORT || 3000;
// Serve static files from React build
app.use(express.static(path.join(__dirname, 'build')));
// API route for tech data (if needed)
app.get('/api/technologies', (req, res) => {
const techData = require('./src/data/techlist.json');
res.json(techData);
});
// Health check endpoint
app.get('/api/health', (req, res) => {
res.json({
status: 'OK',
message: 'FullstackSchool server is running!',
timestamp: new Date().toISOString()
});
});
// Serve React app for all other routes
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
app.listen(PORT, () => {
console.log('🚀 FullstackSchool Server Started!');
console.log(`📱 Local: http://localhost:${PORT}`);
console.log(`🌐 Server running on port ${PORT}`);
console.log('🎯 Ready to teach developers modern tech stacks!');
});