edu-server icon indicating copy to clipboard operation
edu-server copied to clipboard

Add lean when returning data to save up memory

Open Abhishek-kumar09 opened this issue 4 years ago • 3 comments

Lean mongoose doc: https://mongoosejs.com/docs/tutorials/lean.html

Currently we are returning the whole document even if the model doesn't need any further processes. Using lean with the models can be 10x more memory efficient.

Abhishek-kumar09 avatar Jun 19 '21 17:06 Abhishek-kumar09

Hi, I want to try to solve this issue. I am clone hole project after the fork. Then create .env file and fill the data in it. But while running the server at each API call I get bellow JSON output.

{ "statusCode": 409, "message": "Access Denied as Token does not exist", "error": "Conflict" }

Why I am getting this Error? please help me Thank You

zeel-codder avatar Aug 12 '21 13:08 zeel-codder

Hi, I want to try to solve this issue. I am clone hole project after the fork. Then create .env file and fill the data in it. But while running the server at each API call I get bellow JSON output.

{ "statusCode": 409, "message": "Access Denied as Token does not exist", "error": "Conflict" }

Why I am getting this Error? please help me Thank You

Hey , at a lot of API endpoints Auth middleware is set and role guards are set in some as well. So you need to pass the token you get from the client side in the header for those requests to retrieve a response.

Devesh21700Kumar avatar Aug 12 '21 13:08 Devesh21700Kumar

Thanks, I think you are talking about at /api i get authorizations prompt. I give the code, but it only works for /hello router and I am getting the same message for another route. And in /hello router I am also getting bellow message.

{
  "statusCode": 403,
  "timestamp": "2021-08-12T16:00:26.289Z",
  "path": "/",
  "message": "Decoding Firebase ID token failed. Make sure you passed the entire string JWT which represents an ID token. See https://firebase.google.com/docs/auth/admin/verify-id-tokens for details on how to retrieve an ID token.",
  "code": "auth/argument-error"
}

I check my .env file, it has all value right then why am I getting this, any idea.

Thank You

zeel-codder avatar Aug 12 '21 16:08 zeel-codder