Skip to content

Commit

Permalink
change port number to 4000
Browse files Browse the repository at this point in the history
  • Loading branch information
priyaraj7 committed Sep 17, 2022
1 parent 092d75a commit 6abcadc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ npm install
npm start
```

Note: Server runs on http://localhost:4001 and client on http://localhost:3000
Note: Server runs on http://localhost:4000 and client on http://localhost:3000

## Room for Improvement

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Users= ()=> {

// client/src/components/Users.js
const getUsers = async () => {
const response = await fetch("http://localhost:4001/users");
const response = await fetch("http://localhost:4000/users");
const user = await response.json();
setUsers(user);
};
Expand All @@ -26,7 +26,7 @@ const Users= ()=> {
e.preventDefault();
const newUser = { id, name, email };
//console.log(newUser)
const rawResponse = await fetch("http://localhost:4001/users", {
const rawResponse = await fetch("http://localhost:4000/users", {
method: "POST",
headers: {
Accept: "application/json",
Expand All @@ -46,7 +46,7 @@ const Users= ()=> {
const handleDeleteUser = async (deleteUser) => {
// Simple DELETE HTTP request with async await

let response = await fetch(`http://localhost:4001/users/${deleteUser}`, {
let response = await fetch(`http://localhost:4000/users/${deleteUser}`, {
method: "DELETE"
});
await response.json();
Expand Down

0 comments on commit 6abcadc

Please sign in to comment.