Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
jokwuoma committed Aug 16, 2024
1 parent c0ed298 commit 68f4d08
Show file tree
Hide file tree
Showing 38 changed files with 510 additions and 495 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} # Changed GITHUB_TOKEN to MY_GITHUB_TOKEN
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: quiz-app
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} # Changed GITHUB_TOKEN to MY_GITHUB_TOKEN
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: backend
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
- name: Install Snyk CLI
uses: snyk/actions/setup@master
with:
version: latest
snyk-version: latest # Changed from version to snyk-version
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
- name: Install Snyk CLI
uses: snyk/actions/setup@master
with:
version: latest
snyk-version: latest # Changed from version to snyk-version
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

Expand Down
15 changes: 8 additions & 7 deletions backend/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const express = require("express");
const mongoose = require("mongoose");
const cors = require("cors"); // For handling cross-origin requests
// const helmet = require('helmet'); // Import helmet
// const csrf = require('csurf'); // Import csurf
// const cookieParser = require('cookie-parser'); // Import cookie-parser for CSRF token handling
const helmet = require('helmet'); // Import helmet; enable this
const csrf = require('csurf'); // Import csurf; enable this
const cookieParser = require('cookie-parser'); // Import cookie-parser for CSRF token handling; enable this

const app = express();
const port = 3000;
Expand All @@ -12,14 +12,15 @@ require("dotenv").config();
// Middleware
app.use(cors()); // Use this to allow cross-origin requests
app.use(express.json()); // For parsing application/json
// app.use(helmet()); // Use helmet to set secure HTTP headers
// app.use(cookieParser()); // Use cookie-parser middleware
app.use(helmet()); // Use helmet to set secure HTTP headers; enable this
app.use(cookieParser()); // Use cookie-parser middleware; enable this

// // CSRF protection
// const csrfProtection = csrf({ cookie: true });
// app.use(csrfProtection);
const csrfProtection = csrf({ cookie: true }); // enable this
app.use(csrfProtection); // enable this

// MongoDB connection string
process.env.MONGO_URI = "mongodb+srv://jokwuoma:[email protected]/?retryWrites=true&w=majority&appName=Cluster0";
const dbUri = process.env.MONGO_URI;

mongoose
Expand Down
1 change: 0 additions & 1 deletion backend/node_modules/.bin/mime

This file was deleted.

16 changes: 16 additions & 0 deletions backend/node_modules/.bin/mime

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

1 change: 0 additions & 1 deletion backend/node_modules/.bin/nodemon

This file was deleted.

16 changes: 16 additions & 0 deletions backend/node_modules/.bin/nodemon

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

1 change: 0 additions & 1 deletion backend/node_modules/.bin/nodetouch

This file was deleted.

16 changes: 16 additions & 0 deletions backend/node_modules/.bin/nodetouch

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

1 change: 0 additions & 1 deletion backend/node_modules/.bin/nopt

This file was deleted.

16 changes: 16 additions & 0 deletions backend/node_modules/.bin/nopt

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

1 change: 0 additions & 1 deletion backend/node_modules/.bin/semver

This file was deleted.

16 changes: 16 additions & 0 deletions backend/node_modules/.bin/semver

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

57 changes: 43 additions & 14 deletions backend/node_modules/.package-lock.json

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

Loading

0 comments on commit 68f4d08

Please sign in to comment.