Add calender support in server
This commit is contained in:
@@ -4,6 +4,7 @@ require('dotenv').config();
|
||||
|
||||
const { sequelize, cleanupCheckedItems } = require('./models');
|
||||
const shoppingRoutes = require('./routes/shopping');
|
||||
const calendarRoutes = require('./routes/calendar');
|
||||
|
||||
const app = express();
|
||||
const PORT = process.env.PORT || 3001;
|
||||
@@ -15,13 +16,15 @@ app.use(express.urlencoded({ extended: true }));
|
||||
|
||||
// Routes
|
||||
app.use('/api/shopping', shoppingRoutes);
|
||||
app.use('/api/calendar', calendarRoutes);
|
||||
|
||||
// Health check endpoint
|
||||
app.get('/api/health', (req, res) => {
|
||||
res.json({
|
||||
status: 'OK',
|
||||
message: 'Shopping List Server is running',
|
||||
timestamp: new Date().toISOString()
|
||||
message: 'OpenWall Server is running',
|
||||
timestamp: new Date().toISOString(),
|
||||
features: ['shopping', 'calendar']
|
||||
});
|
||||
});
|
||||
|
||||
@@ -52,9 +55,10 @@ const startServer = async () => {
|
||||
|
||||
// Start the server
|
||||
app.listen(PORT, () => {
|
||||
console.log(`Shopping List Server is running on port ${PORT}`);
|
||||
console.log(`OpenWall Server is running on port ${PORT}`);
|
||||
console.log(`Health check available at: http://localhost:${PORT}/api/health`);
|
||||
console.log(`Shopping API available at: http://localhost:${PORT}/api/shopping`);
|
||||
console.log(`Calendar API available at: http://localhost:${PORT}/api/calendar`);
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Unable to start server:', error);
|
||||
|
Reference in New Issue
Block a user