Skip to content

Commit c16cfdc

Browse files
conflict resolved
2 parents 1fec80f + 5b2b86c commit c16cfdc

File tree

9 files changed

+217
-8
lines changed

9 files changed

+217
-8
lines changed

.env.development

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
DB_URI=mongodb://localhost:27017/nufacturing-local-db
22
JWT_SECRET=c551591808a16b19a0c2cf7956aef9009ce27295d25bce18b2953690786e9359
33
EMAIL_USER=ahim@brcodex.com.np
4-
EMAIL_PASS=Iamlocked_11
4+
EMAIL_PASS=Iamlocked_11
5+

.env.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
DB_URI=mongodb://localhost:27017/nufacturing-local-db
22
JWT_SECRET=c551591808a16b19a0c2cf7956aef9009ce27295d25bce18b2953690786e9359
33
EMAIL_USER=ahim@brcodex.com.np
4-
EMAIL_PASS=Iamlocked_11
4+
EMAIL_PASS=Iamlocked_11

.env.production

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
DB_URI=mongodb://localhost:27017/nufacturing-local-db
22
JWT_SECRET=c551591808a16b19a0c2cf7956aef9009ce27295d25bce18b2953690786e9359
33
EMAIL_USER=ahim@brcodex.com.np
4-
EMAIL_PASS=Iamlocked_11
4+
EMAIL_PASS=Iamlocked_11
5+

.env.staging

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
DB_URI=mongodb://localhost:27017/nufacturing-local-db
22
JWT_SECRET=c551591808a16b19a0c2cf7956aef9009ce27295d25bce18b2953690786e9359
33
EMAIL_USER=ahim@brcodex.com.np
4-
EMAIL_PASS=Iamlocked_11
4+
EMAIL_PASS=Iamlocked_11
5+

.githooks/commit-msg

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/sh
2+
#
3+
# An example hook script to check the commit log message.
4+
# Called by "git commit" with one argument, the name of the file
5+
# that has the commit message. The hook should exit with non-zero
6+
# status after issuing an appropriate message if it wants to stop the
7+
# commit. The hook is allowed to edit the commit message file.
8+
#
9+
# To enable this hook, rename this file to "commit-msg".
10+
11+
# Uncomment the below to add a Signed-off-by line to the message.
12+
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
13+
# hook is more suited to it.
14+
#
15+
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
16+
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
17+
18+
# This example catches duplicate Signed-off-by lines.
19+
20+
# test "" = "$(grep '^Signed-off-by: ' "$1" |
21+
# sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
22+
# echo >&2 Duplicate Signed-off-by lines.
23+
# exit 1
24+
# }
25+
26+
#!/bin/sh
27+
28+
# Commit message file passed by Git
29+
commit_msg_file="$1"
30+
# Read the commit message
31+
commit_msg=$(cat "$commit_msg_file")
32+
33+
# Define a regex pattern for the issue ID (adjust this pattern to match your issue IDs)
34+
issue_id_pattern="ABC-[0-9]+"
35+
36+
# Check if the commit message matches the issue ID pattern
37+
if ! echo "$commit_msg" | grep -qE "$issue_id_pattern"; then
38+
echo "Error: Commit message must contain a valid issue ID (e.g., ABC-123)."
39+
exit 1
40+
fi
41+
42+
# Optionally, you can also enforce a specific format for the commit message
43+
if ! echo "$commit_msg" | grep -qE "^($issue_id_pattern).+"; then
44+
echo "Error: Commit message must start with a valid issue ID (e.g., ABC-123: Your message here)."
45+
exit 1
46+
fi

.gitignore

Lines changed: 155 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,156 @@
1+
2+
# Created by https://www.gitignore.io/api/node,vim,git,macos,linux,sublimetext
3+
4+
### Git ###
5+
*.orig
6+
7+
### Linux ###
8+
*~
9+
10+
# temporary files which can be created if a process still has a handle open of a deleted file
11+
.fuse_hidden*
12+
13+
# KDE directory preferences
14+
.directory
15+
16+
# Linux trash folder which might appear on any partition or disk
17+
.Trash-*
18+
19+
# .nfs files are created when an open file is removed but is still being accessed
20+
.nfs*
21+
22+
### macOS ###
23+
*.DS_Store
24+
.AppleDouble
25+
.LSOverride
26+
27+
# Icon must end with two \r
28+
Icon
29+
30+
31+
# Thumbnails
32+
._*
33+
34+
# Files that might appear in the root of a volume
35+
.DocumentRevisions-V100
36+
.fseventsd
37+
.Spotlight-V100
38+
.TemporaryItems
39+
.Trashes
40+
.VolumeIcon.icns
41+
.com.apple.timemachine.donotpresent
42+
43+
# Directories potentially created on remote AFP share
44+
.AppleDB
45+
.AppleDesktop
46+
Network Trash Folder
47+
Temporary Items
48+
.apdisk
49+
50+
### Node ###
51+
# Logs
52+
logs
53+
*.log
54+
npm-debug.log*
55+
yarn-debug.log*
56+
yarn-error.log*
57+
58+
# Runtime data
59+
pids
60+
*.pid
61+
*.seed
62+
*.pid.lock
63+
64+
# Directory for instrumented libs generated by jscoverage/JSCover
65+
lib-cov
66+
67+
# Coverage directory used by tools like istanbul
68+
coverage
69+
70+
# nyc test coverage
71+
.nyc_output
72+
73+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
74+
.grunt
75+
76+
# Bower dependency directory (https://bower.io/)
77+
bower_components
78+
79+
# node-waf configuration
80+
.lock-wscript
81+
82+
# Compiled binary addons (http://nodejs.org/api/addons.html)
83+
build/Release
84+
85+
# Dependency directories
86+
node_modules/
87+
jspm_packages/
88+
89+
# Typescript v1 declaration files
90+
typings/
91+
92+
# Optional npm cache directory
93+
.npm
94+
95+
# Optional eslint cache
96+
.eslintcache
97+
98+
# Optional REPL history
99+
.node_repl_history
100+
101+
# Output of 'npm pack'
102+
*.tgz
103+
104+
# Yarn Integrity file
105+
.yarn-integrity
106+
107+
# dotenv environment variables file
1108
.env
2-
/node_modules
109+
110+
111+
### SublimeText ###
112+
# cache files for sublime text
113+
*.tmlanguage.cache
114+
*.tmPreferences.cache
115+
*.stTheme.cache
116+
117+
# workspace files are user-specific
118+
*.sublime-workspace
119+
120+
# project files should be checked into the repository, unless a significant
121+
# proportion of contributors will probably not be using SublimeText
122+
# *.sublime-project
123+
124+
# sftp configuration file
125+
sftp-config.json
126+
127+
# Package control specific files
128+
Package Control.last-run
129+
Package Control.ca-list
130+
Package Control.ca-bundle
131+
Package Control.system-ca-bundle
132+
Package Control.cache/
133+
Package Control.ca-certs/
134+
Package Control.merged-ca-bundle
135+
Package Control.user-ca-bundle
136+
oscrypto-ca-bundle.crt
137+
bh_unicode_properties.cache
138+
139+
# Sublime-github package stores a github token in this file
140+
# https://packagecontrol.io/packages/sublime-github
141+
GitHub.sublime-settings
142+
143+
### Vim ###
144+
# swap
145+
[._]*.s[a-v][a-z]
146+
[._]*.sw[a-p]
147+
[._]s[a-v][a-z]
148+
[._]sw[a-p]
149+
# session
150+
Session.vim
151+
# temporary
152+
.netrwhist
153+
# auto-generated tag files
154+
tags
155+
156+
# End of https://www.gitignore.io/api/node,vim,git,macos,linux,sublimetext

logs/app.log

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
{"level":"info","message":"Connected to MongoDB for logging.","timestamp":"2024-08-01T00:33:29.259Z"}
9393
{"level":"info","message":"Logger initialized.","timestamp":"2024-08-01T00:34:38.539Z"}
9494
{"level":"info","message":"Connected to MongoDB for logging.","timestamp":"2024-08-01T00:34:38.726Z"}
95+
<<<<<<< HEAD
9596
{"level":"info","message":"Logger initialized.","timestamp":"2024-08-02T09:15:33.437Z"}
9697
{"level":"info","message":"Connected to MongoDB for logging.","timestamp":"2024-08-02T09:15:35.266Z"}
9798
{"level":"info","message":"Logger initialized.","timestamp":"2024-08-02T09:16:29.977Z"}
@@ -142,3 +143,9 @@
142143
{"level":"info","message":"Connected to MongoDB for logging.","timestamp":"2024-08-02T13:13:27.802Z"}
143144
{"level":"info","message":"Logger initialized.","timestamp":"2024-08-02T13:15:28.948Z"}
144145
{"level":"info","message":"Connected to MongoDB for logging.","timestamp":"2024-08-02T13:15:29.641Z"}
146+
=======
147+
{"level":"info","message":"Logger initialized.","timestamp":"2024-08-02T09:10:47.612Z"}
148+
{"level":"info","message":"Connected to MongoDB for logging.","timestamp":"2024-08-02T09:10:47.815Z"}
149+
>>>>>>> 5b2b86cd90b48c0ec771e63cfb4ffe7886844d21
150+
{"level":"info","message":"Logger initialized.","timestamp":"2024-08-02T13:32:41.824Z"}
151+
{"level":"info","message":"Connected to MongoDB for logging.","timestamp":"2024-08-02T13:32:52.336Z"}

src/config/db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ require('dotenv').config();
66
// Connect to MongoDB and add MongoDB transport
77
const connectDB = async () => {
88
try {
9+
console.log(process.env.DB_URI);
910
await mongoose.connect(process.env.DB_URI);
10-
1111
logger.add(new transports.MongoDB({
1212
db: process.env.DB_URI,
1313
collection: 'logs',

src/config/logger.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ const logger = createLogger({
99
format.json()
1010
),
1111
transports: [
12-
new transports.Console(),
13-
new transports.File({ filename: 'logs/app.log' }),
1412
new transports.Console({ format: format.simple(), level: 'error' }),
13+
new transports.File({ filename: 'logs/app.log' }),
1514
],
1615
});
1716

0 commit comments

Comments
 (0)