feat: add orphanage management functionality with image upload and validation

This commit is contained in:
2025-06-11 18:33:42 -03:00
parent bcd47dbdc5
commit 610108950d
12 changed files with 282 additions and 0 deletions

22
backend/src/server.ts Normal file
View File

@@ -0,0 +1,22 @@
import 'dotenv/config';
import express from 'express';
import path from 'path';
import 'express-async-errors';
import cors from 'cors';
import './database/connection'; // This line now automatically runs the connection
import errorHandler from './errors/handler';
import routes from './routes';
const app = express();
app.use(cors());
app.use(express.json());
app.use('/uploads', express.static(path.join(__dirname, '..', 'uploads')));
app.use(routes);
app.use(errorHandler);
app.listen(process.env.PORT || 3101, () => {
console.log('Server is running on http://localhost:' + (process.env.PORT || 3101));
console.log('Environment:', process.env.NODE_ENV || 'development');
});