Skip to content

Commit b9451aa

Browse files
Merge pull request #3 from Stackr2-0/GoogleTrendBackEnd
Google Trend Back-end Complete
2 parents 8df59c4 + a82848f commit b9451aa

File tree

7 files changed

+144
-49
lines changed

7 files changed

+144
-49
lines changed

package-lock.json

Lines changed: 11 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@headlessui/tailwindcss": "^0.1.2",
1616
"concurrently": "^7.6.0",
1717
"express": "^4.18.2",
18+
"google-trends-api": "^4.9.2",
1819
"mongodb": "^5.0.1",
1920
"mongoose": "^6.9.2",
2021
"nodemon": "^2.0.20",
@@ -43,4 +44,4 @@
4344
"prettier": "2.8.4",
4445
"tailwindcss": "^3.2.7"
4546
}
46-
}
47+
}

server/controllers/createError.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const createError = ({ controller, method, type, status, err }) => {
2+
return {
3+
log: `${controller}.${method} \n${type}: ERROR ${
4+
typeof err === "object" ? JSON.stringify(err) : err
5+
}`,
6+
status,
7+
message: {
8+
err: `Error occured in ${controller}.${method}. Check server logs for more details.`,
9+
},
10+
};
11+
};
12+
13+
module.exports = createError;

0 commit comments

Comments
 (0)