CatPtain commited on
Commit
2f630e2
·
verified ·
1 Parent(s): cb4d01c

Upload app.js

Browse files
Files changed (1) hide show
  1. backend/src/app.js +18 -0
backend/src/app.js CHANGED
@@ -56,6 +56,24 @@ app.get('/api/health', (req, res) => {
56
  res.json({ status: 'ok', timestamp: new Date().toISOString() });
57
  });
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  app.use('/api/auth', authRoutes);
60
  app.use('/api/ppt', authenticateToken, pptRoutes);
61
  app.use('/api/public', publicRoutes);
 
56
  res.json({ status: 'ok', timestamp: new Date().toISOString() });
57
  });
58
 
59
+ // GitHub连接状态检查
60
+ app.get('/api/github/status', async (req, res) => {
61
+ try {
62
+ const { default: githubService } = await import('./services/githubService.js');
63
+ const validation = await githubService.validateConnection();
64
+ res.json({
65
+ github: validation,
66
+ environment: {
67
+ tokenConfigured: !!process.env.GITHUB_TOKEN,
68
+ reposConfigured: !!process.env.GITHUB_REPOS,
69
+ nodeEnv: process.env.NODE_ENV
70
+ }
71
+ });
72
+ } catch (error) {
73
+ res.status(500).json({ error: error.message });
74
+ }
75
+ });
76
+
77
  app.use('/api/auth', authRoutes);
78
  app.use('/api/ppt', authenticateToken, pptRoutes);
79
  app.use('/api/public', publicRoutes);