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 ...
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( ...
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( ...
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 ----------------------------------- ...
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 ...
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 ...
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? ...
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? ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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' ...
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 ...
After executing the command: prisma deploy --env-file variables.env An error is displayed as shown below: https://i.stack.imgur.com/OrXrZ.png ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 " ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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") ...
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 ...
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 ...
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 ...
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> ...
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 ...