💻Lab: Integrate sign up with API

You should already have the server-side logic for creating new users with a POST request to /api/users.

Use that API with your new HTML page and some JavaScript to make a working sign-up form to create new users. We'll use this same HTML file for both the signup form.

Validation

Your API should return a 400 (Bad Request) status code if the information in the sign-up form is invalid.

Show these messages in the UI, to let the user know if:

  • The email is already in use by another user

  • The password is too short (or invalid in some other way)

Last updated