-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frontend: Backend connection for sign up page #438
Frontend: Backend connection for sign up page #438
Conversation
const [message, setMessage] = useState(""); | ||
|
||
const registerUser = async (username, email, password) => { | ||
await fetch("http://3.75.151.200:3000/auth/signup", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can put this URL into a .env file and use it from that instead of using it statically on the code since we will need to use this value several times on the front-end project. Also, the backend will deploy the project several times and probably change the URL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably we will use it like;
await fetch("{process.env.BACKEND_URL}/auth/signup"
We have checked for the above review and realized that "adding custom environment variables in react" could be another task instead of a fix for this issue, we will be adding the corresponding issue and initializing a config file in the future. Other than that @xltvy s implementation seems accurate, I am merging this branch to the frontend/dev and closing this pull request. |
PR Description:
Our sign up page had appropriate form fields and validation check. However, the connection between the frontend of sign up page and our REST API has not been established yet.
This PR provides a trustfully functioning REST API connection between the sign up page and the appropriate endpoint.
Notes:
Routine Check