Skip to content

VaaibhaviSingh/Users

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Users

A backend server for an app that takes user's information, stores them and sends them a welcome mail.

Download POSTMAN

Download POSTMAN version according to your OS.

postman

Setting up server

Clone Git repository

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.

Send POST request to .../users

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".

postman

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"
}

postman

Click on SEND.
The firebase database will be updated and mail will be sent to "user@mail".

postman

Send GET request to .../userInformation

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.

postman

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.

postman

Demo

Demo

Features

  • 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

License

MIT © Vaaibhavi Singh

About

Users and Users Information

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published