A backend server for an app that takes user's information, stores them and sends them a welcome mail.
Download POSTMAN version according to your OS.
Clone the git repository in your local device by typing the following command git bash:
$ git clone https://github.com/VaaibhaviSingh/Users.git
Open command prompt and move to the current location of the project(move to Users folder), after that move to functions folder.
$ cd functions
Download the node modules using npm.
$ npm install
Move back to the root folder.
$ cd ..
Run the server using the following command:
$ firebase serve --only functions,hosting
Your server is up and running.
Open postman desktop app, select POST from dropdown list and place the following url in the url section:
http://localhost:5001/users-41f8e/us-central1/app/users
Go to header in the key box write "Content-Type" and in the value box write "application/json".
Go to body select raw option from it then from the dropdown list on the right select JSON(application/json).
In the space below write down the user's information in the form:
{
"username": "username",
"email": "user@mail"
}
Click on SEND.
The firebase database will be updated and mail will be sent to "user@mail".
Open postman desktop app, select GET from dropdown list and place the following url in the url section:
http://localhost:5001/users-41f8e/us-central1/app/userInformation
Click on SEND.
Database content will be shown in the response body.
Same can be done by visiting:
https://users-41f8e.firebaseapp.com/userInformation
The above link will always work even if the server is not running locally.
- Only POST requests can be send to /users
- Only GET request can be send to /userInformation
- Welcome mail is sent to the user on sending the POST request
MIT © Vaaibhavi Singh