sending first data in mongodb
hi guys
in what cases in this
const registration = async (req, res) => {
try {
console.log(req.body);...
Quick question about date and string types
I have a date property (e.g:
createdAt
) from the backend. I'm sending it to the frontend as JSON data. Since JSON only works with strings, what's a good way to handle this as my TypeScript definitions are Date
s. Should I rewrite my types to take Date | string
or should I make some type of parsing function?
I feel like if I make it a Date | string
, it'll be a bit ambiguous. I have multiple functions in the frontend that handle the createdAt
as a Date
, no parsing method needed. But when I get the createdAt from the backend, I'll need to know it's from the backend and parse it as a date in the frontend. Does that make sense? I'm trying to word it but I guess what I'm trying to get at is it might not be 'standardized' when working with it in the frontend. Typing that out, I realize what I could potentially do is rework my frontend methods that use createdAt to get the data from the backend, now that I actually have it setup, that way it'll be in a standardized format...Forms and Site Security Help
Hi everyone! I have most of my site set up with just HTML and CSS, I want to add a form to receive some information such as Name, Phone Number and Email Address and have that emailed to me. I have a php setup for that, but I'm worried that having a form may create a vulnerability in my site and allow it to be hacked (it's happened before). How are you all preventing injection attacks and other exploits?
Where to put the admin dashboard of an e-commerce website?
I want to build an e-commerce website but I donβt know where to make the admin dashboard.
Do I make it a separate website with a separate domain
Or do I make it a separate website with sub-domain (ex. admin.myshop.con)...
Firebase Authentication
I'm trying to incorporate Firebase Authentication to handle simple email/password login to access members-only pages of a website, but although I've incorporated the code to block access to those pages for users who aren't logged in, I am still able to access those pages in a browser when not logged in. Anyone familiar with Firebase Authentication who could help walk me through it?
How do I make a download system for simple exe files
I have a game that I want downloaded when a button is clicked. I've done this using the download attribute for images.
How would I do it for exe files, this is a very small game I'm talking about....
How can I get the string that console.log(obj); would print?
I'm using node.js and I'm familiar with
util.inspect(obj)
but it doesn't seem to stringify the same way as console.log(obj);
, not by default, at least. How do I get a string in the same format as console.log(obj);
would print? I'm asking because I'm using a logger (winston.js) and I want it to print objects this way.Cookie with expiryDate gets deleted once session ends
Hello,
I have some weird behavior I'm not sure I understand. So now the backend sends a set-cookie called refreshToken with the login, and it's working just fine as it does what it's meant to do.
but the issue is that the cookie is removed every time a session ends. Even though it has an expiry of 3 months and I can see it correctly.
What is it that I'm missing?...

Need help hosting a backend service
Hey, does anyone have any experience with web hosting. I've tried my best but I think I'm missing something, and I've been stuck on this for far too long, I'd really appreciate if someone could help me with this. I have fastapi backend that I want to host using nginx for reverse proxy on an azure machine. Please help me out if you can.
php error
I am working with xampp and mysql , i have created there a table with columns but when i insert data it says : MySQL returned an empty result set (i.e. zero rows). (Query took 0.0021 seconds.)
<?php
// Include the database connection file
include '../database.php';
...

Seeking Free Online Resources for Backend Development
I have a good understanding of frontend development. I have also explored backend development but haven't been able to find any good resources for it on YouTube. Can someone help me find good, free online resources for backend development?
how link laravel project to composer ?
how can i link my laravel project to composer after buliding it from terminal ?
Seeking Free Online Resources for Backend Development
"I have a good understanding of frontend development. I have also explored backend development but haven't been able to find any good resources for it on YouTube. Can someone help me find good, free online resources for backend development?"
Connecting app.vue to index.ejs
Hi everyone. I'm having trouble integrating a Vue.js application into my index.ejs file. I am using vite and nodejs. Here are some details:
Context: I'm trying to set up a Vue.js app on a index.ejs that takes an uplaoded image and shows it with a different style (so it is a dynamic thing), but the <div id="app"></div> remains empty.
Issues Encountered:...

How to get from string to anagram in fewest number of swaps?
I'm using Python for the backend of this project. I have a string
l1
that is 19 characters long. I have a string l2
that is an anagram of l1
(l2
has the same characters as l1
but shuffled). I want to get from l1
to l2
in the fewest number of steps, the only move allowed is to swap any two letters (they don't have to be adjacent). l1
can have repeated letters. I'm trying to create a function that outputs the swaps the user needs to make to achieve the least possible number, represented as tuples with the indices of the letters the user needs to swap. For example,
```py
l1 = "abc123456789abcdefg"
l2 = "cca123456789bbadefg"...Authentication with separate frontend and backend
Hi,
I've had some attempts at creating a car marketplace app using React as frontend framework and Express on backend, but I dont know how to approach authentication. I don't want to use JWT's like every tutorial does, it seems to be exaggeration for my case. I've also tried using Spring for backend, but it's too complex.
So, the question is: how to integrate frontend and backend session, so data is consistent(for example, when user changes name, the react app updates it).
...