anish-yadav / api

A nodejs api to connect the website to zoho creator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BC API

node-current

A node js api for bloodconnect to connect zoho with the website forms.

It uses redis to store the oauth token using express-session. To install redis follow this link

Installation

Use the git cli to clone the repo.

git clone https://github.com/anish-yadav/bc-api
cd bc-api
yarn

After cloning add a .env file with the following key in the root directory

RAZORPAY_KEY=xxxxxxxxxxxxxxxxxxxxxxx
RAZORPAY_SECRET=xxxxxxxxxxxxxxxxxxxx
REFRESH_URL=xxxxxxxxxxxxxxxxxxxxxxxx
BASE_URL=xxxxxxxxxxxxxxxxxxxxxxxxxxx
BASE_GET_URL=xxxxxxxxxxxxxxxxxxxxxxx
SESSION_NAME=xxxxxxxxxxxxxxxxxxxxxxx
SESSION_SECRET=xxxxxxxxxxxxxxxxxxxxx

Editing

There are two routes, one for main requests and other for feedbacks.

1. Changing variable name in zoho form

Suppose you changes the Blood_Group to BG in add-donor

// routes/index.ts
data:{
      Name: req.body.Name,
      City_Donor: req.body.City_Donor,
      Email: req.body.Email,
      Phone_Number: "+91" + req.body.Phone_Number,
      //Blood_Group: req.body.Blood_Group,
      BG : req.body.BG,
      Date_of_Birth: changeToddmmyyyy(req.body.Date_of_Birth),
      Source: "Website",
}

*in case you changed City_Region name , make sure to change it in middleware too( helplers/zoho.ts ).

axios.post('/routename',(req,res) => {
   // do something here
}
request body format must be same as that in zoho creator form.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

About

A nodejs api to connect the website to zoho creator


Languages

Language:TypeScript 100.0%