glutonium
Explore posts from serversKPCKevin Powell - Community
•Created by Duckit69 on 4/14/2025 in #help
JWT TOKEN
u also have to pass cookie options where you'll set
secure
to true
or something like that9 replies
KPCKevin Powell - Community
•Created by Duckit69 on 4/14/2025 in #help
JWT TOKEN
cookie parser is for handling cookies
u can use that to easily set ref token and acc token securely in the clients browser
9 replies
KPCKevin Powell - Community
•Created by Duckit69 on 4/14/2025 in #help
JWT TOKEN
u can use cookie parser lib for that
9 replies
KPCKevin Powell - Community
•Created by Ganesh on 4/8/2025 in #help
Error handling practices in ExpressJS
errorHandler middleware
asyncHandler
10 replies
KPCKevin Powell - Community
•Created by Ganesh on 4/8/2025 in #help
Error handling practices in ExpressJS
now i also make a helper function to wrap controllers in try catch (
asyncHandler
) where in the catch
block i am dong next(error)
10 replies
KPCKevin Powell - Community
•Created by Ganesh on 4/8/2025 in #help
Error handling practices in ExpressJS
in my backend the way i have it, is when there is an error , say in user registration controller where username format is invalid, i would simply
throw new Error()
or extend the Error
class to make a custom ApiError
class if i want some extra props and throw that.
i have an error handler middleware which basically when an error is thrown , catches it, and makes a new api response with 500 status code by default otherwise what is provided (this is where extending Error
class comes in handy cause u can add an extra status
pop) and json body with msg and the status code and success: false
(just personal pref)10 replies
KPCKevin Powell - Community
•Created by Arctomachine on 4/1/2025 in #help
How is your day today?
i hate the days i hate 😔
13 replies
KPCKevin Powell - Community
•Created by 13eck on 3/3/2025 in #resources
C Implementation of Flexbox
He gives me code aesthetics vibe
2 replies
KPCKevin Powell - Community
•Created by ghoul on 3/1/2025 in #back-end
Problem understanding Callback
do you have hard time understanding callbacks in general or do you have hard time understanding how to use callbacks in terms of promises specifically
2 replies
KPCKevin Powell - Community
•Created by i_lost_to_loba_kreygasm on 2/24/2025 in #back-end
How to delete objects from `notifications` array after certain amount of time in mongoDB?
what if you have notifications as it's own document
additionally with an author id
5 replies
KPCKevin Powell - Community
•Created by i_lost_to_loba_kreygasm on 2/24/2025 in #back-end
How to delete objects from `notifications` array after certain amount of time in mongoDB?
maybe look at "mongodb TTL"
5 replies
KPCKevin Powell - Community
•Created by saad khan on 2/20/2025 in #back-end
sending first data in mongodb
that's the main error
38 replies
KPCKevin Powell - Community
•Created by saad khan on 2/20/2025 in #back-end
sending first data in mongodb
i want to know what console.error() logs out
38 replies
KPCKevin Powell - Community
•Created by saad khan on 2/20/2025 in #back-end
sending first data in mongodb
i know how try catch works
38 replies
KPCKevin Powell - Community
•Created by saad khan on 2/20/2025 in #back-end
sending first data in mongodb
you're saying the catch() block never gets ran?
38 replies
KPCKevin Powell - Community
•Created by saad khan on 2/20/2025 in #back-end
sending first data in mongodb
i want to know what this logs out
38 replies
KPCKevin Powell - Community
•Created by saad khan on 2/20/2025 in #back-end
sending first data in mongodb
i am talking about this like right here
console.error("Error in registration:", error);
38 replies
KPCKevin Powell - Community
•Created by saad khan on 2/20/2025 in #back-end
sending first data in mongodb
no worries
38 replies
KPCKevin Powell - Community
•Created by saad khan on 2/20/2025 in #back-end
sending first data in mongodb
not the postman one but show the server output (console.error)
38 replies