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

Commenting app.js for clarity #1053

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Commenting app.js for clarity #1053

wants to merge 2 commits into from

Conversation

Onolax
Copy link

@Onolax Onolax commented Apr 10, 2024

Added some comments for clarity of middlewares

Description

-- Changed adminAuth to coreAdminAuth to keep up with the file trend.
-- added some comments for basic clarity

Note - This is my first pull request so I'm sorry if it silly, i do hope it gets merged. Thank you for letting me contribute(even if its just commenting).

Steps to Test

no need

Checklist

  • [done] I have tested these changes
  • [no need] I have updated the relevant documentation
  • [done] I have commented my code, particularly in hard-to-understand areas
  • [no need] I have made corresponding changes to the codebase
  • [done] My changes generate no new warnings or errors
  • [done] The title of my pull request is clear and descriptive

Added some comments for clarity of middlewares
@@ -2,43 +2,43 @@ const express = require('express');

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it's better if you add this comment here:
// Import required packages

@@ -2,43 +2,43 @@ const express = require('express');

const cors = require('cors');
const compression = require('compression');

const cookieParser = require('cookie-parser');

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here:
// Import routers and controllers

// create our Express app
const app = express();

// enable CORS with specific options
app.use(
cors({
origin: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here you can add:
// Allow requests from any origin

// create our Express app
const app = express();

// enable CORS with specific options
app.use(
cors({
origin: true,
credentials: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here:
// Allow sending cookies along with requests

app.use(cookieParser());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here you can add:
// Compress HTTP responses

updated app.js according to review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants