feat: use routes in app.ts

This commit is contained in:
Nemo D'ACREMONT 2024-10-25 19:02:30 +02:00
parent 622c59df4d
commit fda268a033
No known key found for this signature in database
GPG Key ID: 6E5BCE8022FA8276

View File

@ -8,6 +8,7 @@ import path from 'path';
import routes from './routes';
const app = express();
const port = process.env.PORT ?? 3000;
const log_format = (process.env.NODE_ENV === "dev") ? "dev": "combined";
@ -22,6 +23,9 @@ app.set('view engine', 'ejs');
// Add logs
app.use(morgan(log_format));
// Defines endpoints
app.use(routes);
app.listen(port, () => {
return console.log(`Briques is listening at http://localhost:${port}`);
});