Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchanJS committed Oct 16, 2021
1 parent 6634859 commit eb1e0ad
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Axios-Config (https://www.npmjs.com/package/axios-config)
# Npm-Axios-Config

## A npm package for Reactjs, to handle config variables while making any request using axios.

## About axios-config:
## About npm-axios-config:
This function takes two arguments. The first one is the type of the
config variable user want. If user wants to pass a bearer token, then
config variable user want. If user wants to pass a "bearer token", then
he or she must have to pass "privBearerConfig" as the first argument
and the "token" as the second argument. Else the user will get a simple
config variable that can be used for login or registration.
and the "token" as the second argument. If user wants to upload any file
without token, user have to pass only "pubMultConfig" as argument.
Else if user wants to upload any file with token, user must have to pass
"privMultConfig" as the first argument, and the "token" as the second argument.
Else the user will get a simple config variable that can be used for
login or registration.

## How to install?
Open the terminal. Just type "npm i axios-config" and hit enter.
Open the terminal. Just type "npm i npm-axios-config" and hit enter.
17 changes: 17 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ const axiosConfig = (type, token) => {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
}
},
{
headers: {
'Content-Type': 'multipart/form-data'
}
},
{
headers: {
'Content-Type': 'multipart/form-data',
Authorization: `Bearer ${token}`,
}
}
]

Expand All @@ -24,6 +35,12 @@ const axiosConfig = (type, token) => {
case "privBearerConfig":
configInd = 1;
break;
case "pubMultConfig":
configInd = 2;
break;
case "privMultConfig":
configInd = 3;
break;
default:
break;
}
Expand Down

0 comments on commit eb1e0ad

Please sign in to comment.