94,758 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
Score of 0
0 answers
39 views
Razorpay Payment integration issue [closed]
I have integrated razorpay on my MERN Stack website. Whenever I click the upgrade now button on my website, it's not redirecting to razorpay Instead your browser not supported alert comes. I tried ...
- reputation score 1
Advice
0
votes
1
replies
87
views
what's the correct route to put the nested routes in, with featured-based architectrure
I'm learning Express.js and I'm working on a big project on my own, an e-commerce (kind of SaaS).
I'm building the nested routes and controller, service, repo, etc. but the project is so big that I ...
- reputation score 1
Score of 0
1 answer
88 views
ConnectionError: Failed to connect to localhost/SQLEXPRESS01:1433
I am trying to build a web API using Express + Typescript using this Github repo as a starting point. I am using the mssql package with the default tedious driver.
This is my config:
server: '...
- reputation score 2348
Score of 1
1 answer
89 views
How to handle foreign key constraint error when deleting a user in Prisma (one-to-many relation)?
I'm building an Express + Prisma API for a blog system.
I have a User model and a Post model with a one-to-many relationship (one user can have many posts).
When I try to delete a user using:
await ...
Tooling
0
votes
2
replies
62
views
Is there any other way of storing redirectUrl other than session
So the problem is right now lets say if a user have not logged in and he clicks on something which needs to be logged in he pops up in the login page and the then once he login in we redirect him to ...
- reputation score 1
Advice
1
vote
2
replies
96
views
How to prevent DELETE if record is referenced in another table?
I want to delete a record from the selected table using an SQL query, but first I want to check whether any value is associated with that record. To do this, I need to use this validation in the SQL ...
- reputation score 1
Advice
1
vote
4
replies
86
views
Where is this validation typically used?
Is this validation code snippet typically used only with the Put and Delete methods?
if (result.affectedRows === 0) {
return res.status(404).json({
message: "Record not found."
...
- reputation score 1
Advice
1
vote
2
replies
256
views
JS Express Backend! Is there any way to make all of this more compact or more reuseable?
New programmer here, sorry if this is a stupid question. What are your practices when it comes to waypoint? Is there any way to make this code more clean, shorter, or just more "professional"...
- reputation score 1
Advice
1
vote
1
replies
75
views
Node.js + express backend future expansion options
Im working on a basic project which lets you log in via mariadb, displays the users type (e.g admin), getting informations about the selected type of users with the help of database connection. Im ...
Score of 0
0 answers
63 views
passport-onshape OAuth authorization flow fails with 400 "Invalid request" after authentication
I've been attempting to develop an application which has access to OnShape's API, using OAuth as the authentication method. However, I've been running into an issue both with my own code and with the ...
- reputation score 1
Score of 0
1 answer
181 views
Using TypeScript, how do I strongly type PostgreSQL query results?
I am writing a back end in TypeScript using Express and PostgreSQL. I use the pg npm package to connect to the PostgreSQL database and execute a query.
I want to perform some mapping and conversion on ...
- reputation score 702
Best practices
2
votes
1
replies
93
views
What are the best practices for structuring REST API error responses in Node.js applications?
I’m currently building a REST API using Node.js and Express, and I’m trying to understand the best way to structure error responses for both frontend developers and long-term scalability.
Right now I’...
- reputation score 1
Score of 1
1 answer
68 views
No 'Access-Control-Allow-Origin' header is present on the requested resource. While deploying backend api
I created a small backend server that consists of 2 methods: 1 GET and 1 POST
While trying to deploy it crashes on railway and on vercel it do not allow requests
the frontend error I get while using ...
- reputation score 65
Score of 1
1 answer
88 views
Unable to send an HTML file to frontend in Netlify using Node.js
I want to host a Node.js app using Express using Netlify.
This is my server.js code:
const express = require("express")
const path = require("path")
const bodyParser = require(&...
Score of 0
0 answers
77 views
How to transparently proxy Supabase auth v1 through Express for white-label OAuth branding?
I'm trying to mask my Supabase project url (e.g. xyz.supabase.co) behind my own custom API domain (api.mydomain.com) to achieve cleaner OAuth branding. Specifically, I want the google/x "choose ...