Questions tagged [backend]

When it comes to inquiries related to the data processing elements of a system, these specific components are usually accessed by the user interface or business layer components instead of engaging directly with the end-user.

Encountering an error while attempting to connect to the NestJs Google VM Server from a Firebase-hosted NextJs application

A NestJS server has been set up as follows: import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import * as fs from 'fs' import * as https from 'https' import * as express from 'express' import * as http from 'http' import ...

Issue creating a JWT using jsonwebtoken module in Node.js

Could someone help me troubleshoot an issue I'm having while trying to generate a JWT token? The error message "TypeError: Right-hand side of 'instanceof' is not an object" keeps appearing even though the syntax seems correct. const jsonwebtoken = require( ...

Enhance your Magento experience by displaying various action links in a single column on the backend grid

Currently, I am in the process of creating a custom product list within the Magento backend. Here is the code snippet I am using to add a new row: $this->addColumn('action_widget', array( 'header' => Mage::helper( ...

I am currently working on deploying a backend server on elastic beanstalk, but I am encountering a 502 bad gateway error when trying to access the link

Having trouble deploying a backend server on Elastic Beanstalk as I keep getting a 502 bad gateway error when using the link. The server runs on node.js and express, and here is the log output: /var/log/nginx/access.log ----------------------------------- ...

Encountering issues retrieving information from Form utilizing FormData

Working on a 'edit profile' feature within a dashboard using Next.js, Node.js & MongoDB. Note: If you are interested only in the issue, feel free to skip to the backend part. Frontend Firstly, let's discuss the Frontend part. Utilizing ...

What is the web address to access when removing an object from the system?

I have set up a local server to experiment with an API in Django. My model, 'Users', is filled with multiple objects and I am utilizing DefaultRouter. If I wanted to DELETE a specific object from this model, what would the URL look like? For instance, for ...

I wonder what the outcome would be if I used res.send to send a JSON file instead of res.json

Is it possible to send a JSON file using res.send in NodeJs instead of res.json? What are the potential consequences of doing this and why is it recommended to avoid this practice? ...

Leveraging NodeJS functions within an HTML environment

After successfully creating a NodeJS back-end, I encountered a challenge. How can I connect my back-end to my front-end HTML/CSS page and utilize my NodeJS functions as scripts? ...

The invocation of res.json() results in the generation of CastError

An issue occurs with CastError when using res.json() with an argument: CastError: Failed to cast value "undefined" to ObjectId for the "_id" field in the "Post" model Interestingly, using just res.status(), res.sendStatus(), or res.json() without argument ...

What steps can be taken to resolve an error encountered when attempting a dynamic data POST request from the body

Whenever I attempt the post method to fetch data on Postman and store it in a local MongoDB database, I encounter an error. The error message indicates a bad request with a status code of 400. *The following is app.js: var express = require('express'); va ...

Is there a way to successfully submit a form in PHP once it has been validated using JavaScript?

I'm interested in creating a register/login system. I've set up a form in Register.php and handled the validation part in JavaScript, but I'm encountering an issue where no values are being sent to the database upon clicking submit. Register.php <!DOCT ...

Serialization and encoding using json.NewEncoder and json.NewDecoder

I am currently delving into Backend development by constructing a very basic REST API using the gorilla mux library in Go (referring to this tutorial) Here is the code that I have developed so far: package main import ( "encoding/json" "ne ...

Is it possible to host static files alongside running an API on the server?

As a newcomer to web development, I find myself in unfamiliar territory as my friend and I delve into a project involving Vuejs, jade, stylus, and jeet. The combination of all these frameworks is overwhelming, especially since there seems to be no clear ex ...

One of the three identical paths in Node.JS is experiencing issues

I'm brand new to Node.js and currently working on creating a backend api for a project. I have 3 routes in my application: societies, users, and emails. //module for email functionality emailsModule = require('./api/routes/emails')(connection); c ...

What is the best method to incorporate filtering in a CRUD table?

Frontend code: // Importing necessary components and libraries import React, { Component, useState, useEffect } from "react"; import Navbar from "../Navbar/Navbar.js"; import BarChart from "../BarChart/BarChart"; import { Chart, Tooltip, CategoryScal ...

Encountering a hiccup as I attempt to set up a new user through Express NodeJs with Passport integration

I'm encountering an issue while attempting to set up a registration page for users. After trying to make a POST request to save the user in the database, I am getting an error that states TypeError: req.checkBody is not a function. I have also used npm ins ...

Whenever attempting to add a new user, I encounter issues with the Post request not functioning properly

When sending a Post request: I attempt to retrieve the body of the request Validate the body content using express validator Capture any errors that may occur If an error occurs >> reload the create_user page and log the error in the console as foll ...

What is the best method for dynamically increasing the data in a shopping cart?

My goal is to stack cart items dynamically every time the addProduct() function is called. I've successfully captured the data, but I'm facing an issue where the quantity always remains at 1 on each function call. Here's the logic I've implemented: module ...

When attempting to utilize res.sendfile, an error arises indicating that the specified path is incorrect

I am facing an issue with my Express.js server and frontend pages. I have three HTML and JS files, and I want to access my homepage at localhost:3000 and then navigate to /register to render the register.html page. However, I am having trouble specifying t ...

Preventing the occurrence of [ { "description": null } ] in PostgreSQL with a React application running on http://localhost:3000

While working on my localhost project at port 3000 in the Pern Todo List, I encountered a bug. When I type something and click "Add" using a POST request from my React app, the data should be added successfully. However, when I use Postman to make a GET re ...

Importing PHP backend variables into ReactJS with the help of webpack

Is there a way to pass a PHP backend variable into my ReactJS (using react-router) application via Webpack? I'm interested in accomplishing something like this: <?php if ($us->inGroup('Admin')) { ?> <script> var ...

I can't seem to get React Fetch and the expressJS post method to cooperate - what could I be overlooking?

I have been diving into the world of React and recently ventured into working with expressJS. However, I encountered an issue with the POST method as the data is not being successfully posted to the server. While I believe my fetching of the post method is ...

Issue with PHP sessions not being preserved when moving across pages of my site

Why is my php session disappearing as I move around my website? I'm in the process of developing a website that requires admins to log in using a simple username-password combination. The workflow involves creating a session when a user lands on the main ...

I encountered an issue stating, "The function `req.redirect` is not recognized."

Recently starting out with node development. Encountering the error below: TypeError: req.redirect is not a function at Post.create (/var/www/html/node_blog/index.js:40:7) at /var/www/html/node_blog/node_modules/mongoose/lib/utils.js:276:16 a ...

Utilize HTML or JavaScript to make a POST request with Express

Recently, I decided to dip my toes into the world of back-end development using express for the first time. I came across a situation where I needed to make a POST request from an html/js file, and initially used Jquery to accomplish this task. However, I ...

Strategies for accurately mapping values from prisma to TypeScript types?

I'm in the process of developing an ecommerce webshop, utilizing express for my backend and the Prisma ORM. While the system is functional, I believe there is room for optimization, particularly in how I handle types and utilize Prisma as this is my first ...

Is the promises functionality respected by the Nextjs API?

Greetings, I hope all is well with you. I am currently learning NEXTJS and working with its API, but I have encountered a problem. When I click too quickly, the promises seem to get stuck or encounter issues. You can see the tests in action in this brief 3 ...

Attempting to conceal the API, however, the backend is throwing an error

view the error image I am currently in the process of developing an NFT search application that is capable of locating the NFTs associated with a specific wallet address. However, I am faced with the challenge of using Alchemy without exposing the API key ...

Securing JSON-based RESTful services

I am in the process of developing a web application, where I have established a clear separation between my "frontend" server using Lighttpd to serve index.html and javascript. My frontend, powered by Backbone.js, is connected to my Node.js backend webser ...

Ways to populate select json keys with values from an array

I have the following array: [test, usera, test, userb, test, userc, test, userd] This is my JSON: { "data": [ { "email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c9bdacbabdbcbaacbba889a8abaae7aaa6a4">[em ...

Getting a variable from one function to another function involves properly passing the variable as an argument

This is an express server with a simple functionality app.post('/bg-login', (req, res) => { var email = req.body.email; const path = './Databases/User/' + email + '.json'; if (fs.existsSync(path)) { try { // Note that jsonString will be ...

"Encountered npm error: JSON input ended unexpectedly" while trying to install express-mysql-session"

I'm currently developing a nodejs project that uses passportjs for user authentication and mysql as the database. I'm now looking to incorporate session storage by utilizing the ""express-mysql-session" package. However, when attempting to insta ...

I'm sorry, but it seems like my hands are tied - unable to set headers after being sent

Whenever I attempt to log in with my email and password on NodeJS, an error pops up as shown below: (Partial excerpt) Error: Can't set headers after they are sent. at validateHeader (_http_outgoing.js:491:11) at ServerResponse.setHeader (_http_out ...

Struggling with inserting data into MongoDB within my MERN application

I am currently developing a MERN app that allows users to create tasks and collaborate with others. To start my backend, I ran the nodemon index.js command in the git bash terminal. However, every time I try to send POST requests for data, I encounter an e ...

Unable to retrieve query string in Next.js server-side operations

I have structured my NextJS app directory for routing as follows: /app/page.jsx import ListProduct from "@components/products/ListProduct"; import axios from "axios"; const getProducts = async (min, max, category, rating) => { co ...

Separating development and production environment variables in Node.js is crucial for maintaining a

I'm currently working on a Node.js server and in my service files, I am fetching the URL for requests from a custom config.json file that I have created. However, I am facing an issue where I need to use different URLs for development and production enviro ...

What is the proper way to structure the DATETIME format when making an API request to mySQL?

Frontend code: import React, { Component, useState, useEffect } from "react"; import Navbar from "../Navbar/Navbar.js"; import BarChart from "../BarChart/BarChart"; ... Backend code: //set up express server const express = require("express"); const app ...

What could be causing Nextjs13 to fail in recognizing an authentication route, resulting in a 404 error?

I have been working on a project utilizing NextJs v13 with Strapi v4 as the backend. My project includes separate layouts for the site, login, and dashboard. While working on the login section, I implemented NextAuth for authentication. However, upon submi ...

Step-by-step guide on writing to a JSON file using Node.js

I am currently developing a Facial Recognition web application using React for the frontend and Node.js for the backend. You can find more information about my project here. So far, I have completed the frontend part where users manually add 128-d descript ...

There is no data in the request body when submitting form data

When attempting to send form data using a simple post request to my backend, I noticed that the body is always empty. To troubleshoot this issue, I modified the content type to application/json and changed the data to JSON format, which allowed me to succe ...

Steps to establish a connection with a remote MYSQL database using the actual IP address in Node.js

In my Nodejs file, I have set up the connection as follows. The issue arises when attempting to connect to the remote database on a server. module.exports = { host: '234.32432.32432',//this is an example IP address and not a real one. user: 'bob' ...

Is it possible to achieve compatibility between Python and PHP in web development?

I am currently engaged in a legacy PHP project that relies heavily on PHP for its backend operations. However, I have a strong interest in scripting and developing fun and useful features using Python. My question is: Is there a way to incorporate Python ...

Encountering an error while executing `prisma deploy` using the `variables.env`

After executing the command: prisma deploy --env-file variables.env An error is displayed as shown below: https://i.stack.imgur.com/OrXrZ.png ...

The response from $http.get is not defined

Currently, I am working on the front end of a project using HTML, while utilizing Python for the back end. To handle communication between the two, I have integrated AngularJS. The challenge I am currently encountering pertains to retrieving responses fro ...

A guide on utilizing multer-sftp for downloading files

I've been working on this code, but after searching online I still haven't found a way to download a file from the remote server. I can successfully upload files to the server, but downloading them is posing a challenge. var storage = sftpStorag ...

Is there a way to retrieve data outside of the "post" function?

I have an Express server and I need to access data obtained outside of the post function or in other post functions. Here is the code snippet: app.post('/bg-login', (req, res) => { var user; req.body.email; req.body.p ...

Building nested schemas in Mongoose for handling multiple arrays of objects

I'm currently in the process of developing a REST API using node, express, and MongoDB for a web application that has three main sections on the frontend: Quotes Stories News When a user clicks on Quotes, they should only see quotes; the same goes for S ...

Checking the efficiency of Graphql API

Currently, I am in the process of optimizing key features within my Node.js API which incorporates GraphQL. This API serves as a proxy, receiving requests from various sources and forwarding them to multiple APIs based on the request. I am interested in ...

Every attempt to send data using ExpressJS results in a consistent 500 error code being returned

Currently, I am in the process of developing an API that involves web scraping. However, I seem to be facing a challenge that is perplexing me. The issue revolves around the GET request route provided below: const router = require("express").Router(); con ...

What is the best way to redirect using Express, EJS, and external JavaScript files?

I am facing an issue with my login form. After collecting the user's email and password, I use JavaScript fetch to send the data to Express. Then, I validate the inputs using express-validator. However, when I try to redirect to another page using res ...

Moving a window in Pyqt5 using QtWebChannel

My goal is to enable the mousePressEvent and mouseMoveEvent events in order to move my app window using QtWebChannel. To achieve this, I am utilizing self.setWindowFlags(QtCore.Qt.FramelessWindowHint) to eliminate the default window flag and create a cust ...

I am unable to retrieve the req.body or the body content in a post request. The code functions properly when using hardcoded JSON

Take a look at my code: controllers/task When testing in Postman, I'm getting validation errors I've even tried using a body parser, but it doesn't seem to be working either. Check out app.js ...

Upcoming API and backend developments

When working with the NEXT project, API Routes provide the ability to create an API endpoint within a Next.js application. This can be achieved by creating a function in the pages/api directory following this format: // req = HTTP incoming message, res = H ...

Looking to integrate Nestjs with additional Redis functionalities?

I recently set up a nestjs backend with redis for caching by following the instructions in the official documentation . To achieve this, I utilized the cache-manager-redis-store package and included the necessary code in my app.module.ts file as shown bel ...

Exploring the Connection Between Express.js and CORS

I developed a frontend using react.js and an API server using express.js. To handle CORS, I utilized the cors package as shown below: var passport = require("passport"); const express = require('express'); const cors = require('cors'); const app ...

Event typeORM on afterUpdate in NestJS

After every update of my data in the log table, I want to insert an entry into another table. To achieve this, I have created an EntitySubscriberInterface. The event is triggering correctly, but the entity array does not include the updated id. async afte ...

"What are the necessary components to include in UserDTO and what is the reasoning behind their

Presenting the User entity: package com.yogesh.juvenilebackend.Model; import jakarta.annotation.Generated; import jakarta.persistence.*; import lombok.*; @Entity @Getter @Setter @NoArgsConstructor @AllArgsConstructor @RequiredArgsConstructor public class ...

The port number for localhost remains constant

Any ideas on resolving the issue of an app running on the wrong port? I would like my localhost to use port 8080 instead of 5000. I attempted to run port 8080 through the terminal, but it was unsuccessful. Port 5000 is not compatible with my current proj ...

The persistent issue of the Mongo Connection repeatedly shutting down

A snippet from a console log: Attempted to GET data from http://localhost:5000/api/goals/, but encountered an error: connect ECONNREFUSED 127.0.0.1:5000. Here are the request headers: User-Agent: PostmanRuntime/7.29.0 Accept: / Postman-Token: 508773a0-790 ...

The backend post request is returning only "undefined" in JavaScript

Hey there, I'm still learning JS so please bear with me. I've been working on incrementing a value in a JSON file within my JS backend app. However, whenever I try to increase the associated value by the key, it ends up creating a new section labeled as " ...

ajax receives an empty responseText after sending intermediate data to Python on the backend

Initially, the frontend passed an identification to the backend. The backend utilized this identification to retrieve data from the database. The extracted data then underwent additional processing on the backend before being sent back to the frontend. Be ...

Front-end and back-end seamlessly integrated in Next.js

I am new to this area and curious about whether it's better to include an API within my project or have a separate back-end integrated. I understand that having a separate backend means paying for two hosting services, whereas incorporating it within ...

Employing asynchronous operations and the power of async/await for achieving seamless integration

I am currently facing an issue where I need to retrieve queries from a database stored in Postgres. A function is utilized, which employs a callback mechanism. In order to fetch rows from the database, there exists a function called getRecipesByCategoryFo ...

Unable to access attributes of an unknown object (referencing 'Person')

I'm currently facing an issue when trying to POST data from my Next.js project to my MySQL database. Here is my frontend code: import React from 'react' import { useReducer, useEffect, useState } from 'react' import Axios from &ap ...

Unlocking superior performance with AWS Amplify and NextJS 12 - The Surprising Fluctuation in Backend

My recent experience with AWS Amplify and Next.js 12 involved accepting a "performance improvement" that initially seemed successful. However, an unexpected issue arose where everything became linked to my dev backend environment post-performance improveme ...

Tips for expanding the count and confirming whether the user is a fan using node.js?

I am looking to update the like and dislike count in videoSchema based on the likedislikeSchema. Can you provide guidance on how to achieve this? For example, when a user likes a video, the like count should be incremented in videoSchema, and the videoId ...

Integrating individual front end JavaScript files into an Express.js application

I've been working on a JavaScript file that contains over 200 lines of code for the front end logic of my project. It handles interactions like button clicks, image displays, and more, similar to a game. However, I'm struggling to figure out how to link o ...

What is the best way to include a new user in the memory database when there is no database or storage back-end?

During an online test, I was given the task of adding a user to a database stored in memory. The request body required JSON formatting as shown below: { "id": "aabbbccddeeefff", "name": "User One", "hobbies": [ "swim", "sing", "workout" ] } (Users ...

Is there a way to retrieve a file from Google Drive and showcase it on a webpage using the Google Drive API in NextJS?

Despite my efforts in exploring the documentation and watching various videos, I am still struggling with understanding what to do. As a beginner in Next.js and React, I am currently working on a project that involves fetching a document from Google Driv ...

What could be causing the errorHandler middleware to be triggered twice in an express application?

const express = require('express') const app = express(); function middleWear1(req, res, next) { throw Error() } function errorHandler(err, req, res, next) { console.log("error handled"); res.end("error occured at server") ...

Issue encountered with implementing Adminjs: "Unable to use import statement outside a module"

Currently diving into node express js. I am exploring the realm of writing backend code using express js and now looking to incorporate adminjs into my project. Delving into this new territory, I followed the official documentation of the adminjs express p ...

Managing Prisma error handling in Express

Dealing with error handling using ExpressJS and Prisma has been a challenge for me. Anytime a Prisma Exception occurs, it causes my entire Node application to crash, requiring a restart. Despite looking at the Prisma Docs and doing some research online, I ...

Utilizing handpicked information in Angular: A beginner's guide

Being new to Angular and programming in general, I am currently navigating through the intricacies of Angular and could use some guidance on utilizing selected data. For instance, I would like to use a personnel number view image here and send it to the b ...

The v-data-table is unable to fetch the user list information from the API using Axios

How can I solve the issue of displaying "No data available" in the user list data table on my userDirectory page? I have created a userDirectory page with a subheader and a data table from Vuetify, but it seems to have no data available. <template> ...

Encountering Axios errors while executing API calls at a high frequency

Recently, I have been facing some challenges with making API calls from localhost using axios in a loop. While it works smoothly at times, most often I encounter errors like: cause: Error: connect ECONNREFUSED ::1:8000 at TCPConnectWrap.afterConnect ...