fixed routing issue

This commit is contained in:
MattLeo 2025-12-09 08:57:54 -06:00
parent 513305a5ab
commit b36feabc98

View File

@ -56,12 +56,6 @@ if (!fs.existsSync('./media')) {
initDb().then(() => {
app.use('/api/auth', authRoutes);
app.use('/api/articles', articleRoutes);
app.use('/api/admin', adminRoutes);
app.use('/api/categories', categoryRoutes);
app.use('/api/tags', tagRoutes);
app.get('/', (req, res) => {
res.json({ message: 'Server is running' });
});
@ -676,11 +670,11 @@ initDb().then(() => {
app.use('/media', express.static(path.join(__dirname, 'media')));
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'frontend/dist', 'index.html'));
});
app.listen(PORT, () => {
console.log(`Server listening on ${PORT}`);
});
});
}).catch(err => {
console.error('Failed to initialize database:', err);
});