2024-08-04 17:02:22 +00:00
|
|
|
const express = require('express');
|
|
|
|
|
|
|
|
// Invoke express app
|
|
|
|
const app = express();
|
|
|
|
|
2024-08-04 17:13:02 +00:00
|
|
|
const APIRoutes = require('./routes/api');
|
2024-08-04 17:23:21 +00:00
|
|
|
const Loggerware = require('./middleware/Logger');
|
2024-08-04 17:13:02 +00:00
|
|
|
|
2024-08-04 17:23:21 +00:00
|
|
|
// Set up middleware
|
|
|
|
app.use(Loggerware);
|
2024-08-04 17:02:22 +00:00
|
|
|
|
2024-08-04 17:23:21 +00:00
|
|
|
// Set up API routes
|
2024-08-04 17:13:02 +00:00
|
|
|
app.use(APIRoutes);
|
2024-08-04 17:02:22 +00:00
|
|
|
|
2024-08-04 17:53:43 +00:00
|
|
|
// Listen on port 5000
|
2024-08-04 17:50:39 +00:00
|
|
|
app.listen(5000, () => {
|
|
|
|
console.log('Server is listening on port 5000');
|
2024-08-04 17:02:22 +00:00
|
|
|
});
|