2026-03-04 16:03:04 +00:00
|
|
|
import express from 'express';
|
|
|
|
|
import dotenv from 'dotenv';
|
|
|
|
|
import authRoutes from './routes/auth.js';
|
|
|
|
|
import helpRequestRoutes from './routes/helpRequests.js';
|
|
|
|
|
import offerRoutes from './routes/offers.js';
|
|
|
|
|
import reviewRoutes from './routes/reviews.js';
|
2026-03-04 16:51:07 +00:00
|
|
|
import addressRoutes from './routes/addresses.js';
|
2026-03-04 16:59:39 +00:00
|
|
|
import contactRoutes from './routes/contacts.js';
|
2026-03-04 18:02:42 +00:00
|
|
|
import profileRoutes from './routes/profile.js';
|
2026-03-06 23:06:22 +00:00
|
|
|
import logger from './middleware/logger.js';
|
2026-03-04 16:03:04 +00:00
|
|
|
|
|
|
|
|
dotenv.config();
|
|
|
|
|
|
|
|
|
|
const app = express();
|
|
|
|
|
app.use(express.json());
|
|
|
|
|
|
|
|
|
|
app.get('/health', (_req, res) => res.json({ status: 'ok' }));
|
|
|
|
|
|
|
|
|
|
app.use('/auth', authRoutes);
|
|
|
|
|
app.use('/requests', helpRequestRoutes);
|
|
|
|
|
app.use('/offers', offerRoutes);
|
|
|
|
|
app.use('/reviews', reviewRoutes);
|
2026-03-04 16:51:07 +00:00
|
|
|
app.use('/addresses', addressRoutes);
|
2026-03-04 16:59:39 +00:00
|
|
|
app.use('/contacts', contactRoutes);
|
2026-03-04 18:02:42 +00:00
|
|
|
app.use('/profile', profileRoutes);
|
2026-03-04 16:03:04 +00:00
|
|
|
|
|
|
|
|
const port = Number(process.env.PORT || 3000);
|
|
|
|
|
app.listen(port, () => {
|
|
|
|
|
console.log(`helpyourneighbour backend listening on ${port}`);
|
|
|
|
|
});
|