The URL http://localhost:3001/users/signup returned a 404 error, indicating that the page was

Hello, I've been working on setting up my user routes using Sequelize for MySQL. However, when I try to test my requests by sending them to http://localhost:3001 via Postman, I'm receiving a 404 (Not Found) error for http://localhost:3001/users/signup. Although all my user routes seem to be correct and my Nodemon server is running without any issues. Interestingly, if I navigate to http://localhost:3001/users, I can see the test requests being processed.

Below are snippets from my server.js file:

const http = require("http");
const app = require("./app");

// Rest of the server.js content goes here...

The contents of my app.js file:

const express = require("express");
// Additional code from app.js goes here...

Next, let's take a look at my user route:

const express = require("express");
// Further details about the user route go here...

Now, moving on to my models:

const { Model } = require("sequelize");

// Additional model information can be found within this section...

Lastly, let's review the users controller:

const bcrypt = require("bcrypt");
const jwt = require("jsonwebtoken");
// The remaining content of the users controller is listed below...

Answer №1

The designated route for your Users is api/users/. Please be sure to send your request to

http://localhost:3001/api/users/signup

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Error Encountered in jQuery UI SelectMenu

Struggling to integrate the jQuery UI SelectMenu, I keep encountering the same error in the browser console. Below is the HTML Code: <select name="files" id="files"> <optgroup label="Scripts"> <option value="jquery">jQuery.js</ ...

How can I convert a Java array of arrays into JavaScript?

When working with Java, I need to create a JSON structure similar to this: [ [ timestamp , number ],[ timestamp , number ] ] This structure is necessary for displaying data on Highcharts graphs. I initially used a "LinkedList of LinkedList" format to ...

Information not displaying correctly on the screen

My latest project is a recipe app called Forkify where I am utilizing JavaScript, npm, Babel, Webpack, and a custom API for data retrieval. API URL Search Example Get Example The app displays recipes with their required ingredients on the screen. Addit ...

Share the hyperlink to a webpage with someone else

In my SQL command, I have a unique feature that retrieves the complete URL value of the current page: [##cms.request.rawurl##]. This code returns the entire URL. I need to send this address to another page and load it into a special div called "load-fac". ...

Error retrieving resource: server returned a 404 status code indicating file not found for javaScript and CSS files

I can't seem to get my css and js files to load on the server. Here is how my file structure looks like: GAME_Folder https://i.sstatic.net/wzfB3.png HTML doctype html head link(href='https://fonts.googleapis.com/css2?family=Press+Start+2P& ...

Introducing a fresh addition to the array

I am looking for a way to create a new array without modifying the original one. Currently, there is a function that adds a new object to an existing array, but I need a different method to achieve this. Can someone suggest a solution? const arr = [ ...

Issue arises with foreign key constraint while inserting data into database

Attempting to remove previous tuples from the flights table Error: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationExcepti on: Duplicate entry 'AAH196' for key 'PRIMARY' com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityCo ...

Troubleshooting problems with Chart.js scaling upon page load

Using chart.js to display a horizontal bar graph. Interestingly, upon the initial loading of the website, only a fraction of one bar is visible, and the graph fails to properly adjust to the display size until the window is manually resized. This issue per ...

Is there another way to implement this method without having to convert snapshotChanges() into a promise?

When trying to retrieve cartIdFire, it is returning as undefined since the snapshot method is returning an observable. Is there a way to get cartIdFire without converting the snapshot method into a promise? Any workaround for this situation? private asyn ...

Sending an array from JavaScript to PHP and then back to JavaScript

I have a task to transfer an array from one webpage to a PHP page for it to be saved in a file, and then another webpage has to retrieve that array from the file. Currently, I have an array in JavaScript containing all the necessary information: JavaScri ...

Combining Multiple Optional Async AJAX Calls

In my Angular 1.5.8 app, I have different views that require various combinations of the same 3 ajax requests. Some views need data from all three endpoints, while others only need data from one or two. To efficiently manage the retrieval of this data, I ...

Combining and organizing user authentication data from nextauth.js provider and credentials in a session (nextjs)

I am currently working on a project that utilizes nextauth version 4.19 with 'credentials' (db) and Google as the provider. Everything runs smoothly with the 'credentials' provider, and I am able to retrieve a session.user containing a ...

Angular not displaying retrieved data

Having an issue with fetching data from an API using Angular. Although the console log confirms that the data is successfully fetched, it doesn't display on the page. Any assistance would be greatly appreciated. Take a look at my code: app.component. ...

What is the most efficient way to transfer an item from one component to another in React

When I try to assign one object into another, it does not get added as a key in the new object. var check = Object.assign(product, cart_item); If you look at the image below https://i.sstatic.net/jf2xK.png I would appreciate any insights on how can I add ...

Can a correctly typed text alter the image?

I am working on a feature where the image changes when the user enters the correct text, indicating that it was typed correctly. However, I am facing an issue where if the first two characters are entered correctly but the third one is not, the image still ...

What is the best way to add prefixes to my SCSS style sheets?

After attempting to add prefixes to my scss files, I came across the autoprefixer tool. However, I discovered that it only supports CSS files. Is there a way to utilize autoprefixer with scss files? Here are the commands for Autoprefixer: npm install post ...

Is there a way to use Jest spyOn to monitor a function that is returned by another function?

I'm curious about why the final assertion (expect(msgSpy).toBeCalled()) in this code snippet is failing. What adjustments should be made to ensure it passes? it('spyOn test', () => { const newClient = () => { const getMsg = ...

Ways to identify when a person has scrolled a specific distance

Is it possible to modify the appearance of my top navigation bar once the page has been scrolled a specific number of pixels? I assume this requires some sort of listener to track the amount of scrolling. I came across element.scrollTop, but it doesn' ...

What is the best way to determine an employee's bonus by taking into account their sales goals

Looking to determine which employees have met their sales targets and calculate the appropriate bonus based on those targets. create table ta( empid int(10), sales int(10) ); empid - sales 101 - 9898 201 - 988 301 - 87988 401 - 88 501 - 2 ...

Executing intricate MongoDB collection queries using Node.js

I have a vast collection of records stored in MongoDB structured like the following example: { "key" : "a" ,"data" : "value1" , "lastname" : "Doe" }<br> { "key" : "ab" , "data" : "value1" , "lastname" : "Doe" }<br> { "key" : "abc" , "data" : ...