Compare commits

..

No commits in common. "b75dce535227b599b0942c529030b4ead959d00d" and "6ada601a8164658f75c5ccaaeaf5043c15ca7843" have entirely different histories.

9 changed files with 2 additions and 114 deletions

3
.gitignore vendored
View File

@ -10,6 +10,3 @@ backend/.env
# Frontend-specific
frontend/node_modules/
# Database-specific
database/data/

View File

@ -1,13 +0,0 @@
FROM node:14.15.4
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . .
EXPOSE 5000
CMD ["node", "index.js"]

View File

@ -1,18 +0,0 @@
const express = require('express');
// Invoke express app
const app = express();
const APIRoutes = require('./routes/api');
const Loggerware = require('./middleware/Logger');
// Set up middleware
app.use(Loggerware);
// Set up API routes
app.use(APIRoutes);
// Listen on port 5000
app.listen(5000, () => {
console.log('Server is listening on port 5000');
});

View File

@ -1,11 +0,0 @@
const express = require('express');
const Loggerware = express.Router();
Loggerware.use((req, res, next) => {
let time = new Date().toLocaleTimeString();
console.log(time + ' | Request received | path: ' + req.path + ' | method: ' + req.method);
next();
});
module.exports = Loggerware;

View File

@ -9,7 +9,6 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"dotenv": "^16.4.5",
"express": "^4.19.2",
"mongoose": "^8.5.2",
"socket.io": "^4.7.5"
@ -229,17 +228,6 @@
"npm": "1.2.8000 || >= 1.4.16"
}
},
"node_modules/dotenv": {
"version": "16.4.5",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz",
"integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://dotenvx.com"
}
},
"node_modules/ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",

View File

@ -3,15 +3,13 @@
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "nodemon index.js"
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"dotenv": "^16.4.5",
"express": "^4.19.2",
"mongoose": "^8.5.2",
"socket.io": "^4.7.5"

View File

@ -1,9 +0,0 @@
const express = require('express');
const APIRoutes = express.Router();
APIRoutes.get('/', (req, res) => {
res.json({'message': 'Hello World!'});
});
module.exports = APIRoutes;

View File

@ -1,31 +0,0 @@
services:
backend:
container_name: backend
build:
context: ./backend
dockerfile: Dockerfile
working_dir: /app
ports:
- "5000:5000"
volumes:
- ./backend:/app
frontend:
container_name: frontend
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
volumes:
- ./frontend:/app
- ./frontend:/node_modules
db:
container_name: database
image: mongodb/mongodb-community-server
ports:
- "27017:27017"
volumes:
- ./database/data:/data/db

View File

@ -1,13 +0,0 @@
FROM node:14.15.4
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]