Skip to content

Commit 8406247

Browse files
committed
2 parents 230f963 + 1b9ec04 commit 8406247

29 files changed

Lines changed: 2236 additions & 967 deletions
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.

‎.github/ISSUE_TEMPLATE/custom.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Custom issue template
3+
about: Describe this issue template's purpose here.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

‎backend/app.js‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const mongoose = require('mongoose')
33
const cors = require('cors')
44
const dotenv = require('dotenv');
55
const app = express();
6+
const GC = require('./utils/GC');
67
dotenv.config();
78

89
// Middleware
@@ -53,16 +54,22 @@ app.get('/', (req, res) => {
5354
res.status(200).json({ status: "success", message: "urBackend API is running 🚀" })
5455
});
5556

56-
// 🛡️ FAULT TOLERANCE: Global Error Handler
57+
// FAULT TOLERANCE: Global Error Handler
5758
app.use((err, req, res, next) => {
59+
if (err instanceof SyntaxError && err.status === 400 && 'body' in err) {
60+
return res.status(400).json({
61+
error: "Invalid JSON format",
62+
message: "Check your request body syntax. Stray characters outside the JSON object are not allowed."
63+
});
64+
}
65+
5866
console.error("🔥 Unhandled Error:", err.stack);
5967
res.status(500).json({
6068
error: "Something went wrong!",
6169
message: err.message
6270
});
6371
});
64-
65-
// 🛡️ DB CONNECTION & SERVER START
72+
// DB CONNECTION & SERVER START
6673
// (Only connect if NOT in Test Mode)
6774
if (process.env.NODE_ENV !== 'test') {
6875

0 commit comments

Comments
 (0)