38 lines
900 B
JavaScript
38 lines
900 B
JavaScript
import axios from "axios";
|
|
import dotenv from "dotenv"
|
|
|
|
|
|
export const fetch = async (req, res)=>{
|
|
try{
|
|
|
|
let config = {
|
|
headers: {
|
|
'Authorization': 'Bearer ' + `${process.env.VERIFY_ME_PUBLIC_TEST_SECRET}`,
|
|
'Content-Type': 'application/json'
|
|
}
|
|
};
|
|
|
|
const bodyParameters = {
|
|
"firstname":"John",
|
|
"lastname":"Doe",
|
|
"dob":"04-04-1944"
|
|
};
|
|
|
|
axios.post(
|
|
`${process.env.VERIFY_ME_ENDPOINT}/10000000001`,
|
|
bodyParameters
|
|
,
|
|
config
|
|
)
|
|
.then( ( response ) => {
|
|
return res.json({res : response.data});
|
|
//console.log( response )
|
|
} )
|
|
.catch()
|
|
|
|
|
|
|
|
}catch(error){
|
|
res.status(500).json({error: "Internal Server error"});
|
|
}
|
|
} |