Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #24

Merged
merged 37 commits into from
Aug 18, 2024
Merged

test #24

Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9c858da
Merge pull request #13 from Leave-it-blank/dev-doc
Mayank-Tripathi32 Nov 21, 2022
00b0641
Update README.md
Mayank-Tripathi32 Nov 21, 2022
2f65b3a
Merge pull request #14 from Leave-it-blank/dev-release-beta
Mayank-Tripathi32 Nov 22, 2022
2980b6b
added logging support
Mayank-Tripathi32 Nov 22, 2022
93bbd38
Merge pull request #15 from Leave-it-blank/dev-logging
Mayank-Tripathi32 Nov 22, 2022
c81ff42
fixed types and added some optimizations
Mayank-Tripathi32 Nov 22, 2022
604366e
minor chanes
Mayank-Tripathi32 Nov 22, 2022
98bb626
removed builds
Mayank-Tripathi32 Nov 22, 2022
69403ce
added builds to gitignore
Mayank-Tripathi32 Nov 22, 2022
f0c7249
Merge pull request #16 from Leave-it-blank/dev-opt
Mayank-Tripathi32 Nov 22, 2022
d025961
Update README.md
Mayank-Tripathi32 Nov 22, 2022
4b3f4c0
Update README.md
Mayank-Tripathi32 Nov 22, 2022
23c30be
Update README.md
Mayank-Tripathi32 Nov 22, 2022
ba9f8f8
Update README.md
Mayank-Tripathi32 Nov 22, 2022
4e4dbc8
Update README.md
Mayank-Tripathi32 Nov 22, 2022
5d702b7
Update README.md
Mayank-Tripathi32 Nov 22, 2022
f1b1215
added docker support
Mayank-Tripathi32 Nov 25, 2022
730266f
Merge pull request #17 from Leave-it-blank/dev-docker
Mayank-Tripathi32 Nov 25, 2022
671d187
minor redis network fix
Mayank-Tripathi32 Nov 25, 2022
a57b9a9
Merge pull request #18 from Leave-it-blank/dev-docker
Mayank-Tripathi32 Nov 25, 2022
2d04689
fixed bug with login and registeration crash.
Mayank-Tripathi32 Nov 25, 2022
339e430
Merge pull request #20 from Leave-it-blank/bug-fix-login-register
Mayank-Tripathi32 Nov 25, 2022
4bca0ce
Update README.md
Mayank-Tripathi32 Dec 2, 2022
34fe3ab
Update .env.example
Mayank-Tripathi32 Dec 2, 2022
3e128a0
Update README.md
Mayank-Tripathi32 Dec 2, 2022
30892da
Bump jsonwebtoken from 8.5.1 to 9.0.0
dependabot[bot] Dec 23, 2022
214e899
Merge pull request #22 from Leave-it-blank/dependabot/npm_and_yarn/js…
Mayank-Tripathi32 Dec 24, 2022
5e532ae
refactor: rewrote code for JWT auth & with new module based arch
Mizety Aug 15, 2024
2c5a17c
refactor: added new module based arch & JWT auth with blacklisting
Mizety Aug 15, 2024
beef850
feat: added basic user role management with middleware
Mizety Aug 15, 2024
ffef882
feat: added reset password with nodemailer
Mizety Aug 15, 2024
d6f7769
feat: added role based authentication, added profile routes & API cru…
Mizety Aug 17, 2024
4d08b3c
Remove: docker, removed while I update for v3
Mizety Aug 17, 2024
7a44a53
feat: added helmet, cors
Mizety Aug 17, 2024
6f0d0d2
docs: Updated Readme file
Mizety Aug 17, 2024
86954f5
refactor: small fix
Mizety Aug 17, 2024
da025c8
Merge pull request #25 from Mizety/master
Mayank-Tripathi32 Aug 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: added helmet, cors
  • Loading branch information
Mizety committed Aug 17, 2024
commit 7a44a53262a214f4c83a722e30183fa798415935
40 changes: 40 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -5,8 +5,10 @@
"@prisma/client": "^5.18.0",
"bcryptjs": "^2.4.3",
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"helmet": "^7.1.0",
"jsonwebtoken": "^9.0.2",
"morgan": "^1.10.0",
"nodemailer": "^6.9.14",
@@ -21,6 +23,7 @@
},
"devDependencies": {
"@types/bcryptjs": "^2.4.6",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/jsonwebtoken": "^9.0.6",
"@types/morgan": "^1.9.9",
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -7,12 +7,19 @@ import fs from "fs";
import path from "path";
import morgan from "morgan";
import dotenv from "dotenv";
import helmet from "helmet";
import cors from "cors"; // Import CORS

dotenv.config();

const app = express();

const port = process.env.PORT || 4000;

// Implemented Security Policy
app.use(helmet());
app.use(cors());

// Middleware for logging requests
// Create a write stream (in append mode) for logging to a file
const logStream = fs.createWriteStream(path.join(__dirname, "access.log"), {