export const useApiFetch = (request,opts = {}) => {
const runtimeConfig = useRuntimeConfig();
const RTConfig = useRuntimeConfig().public;
if (opts.query === undefined) opts.query = {};
if (opts.method === 'POST'){
opts.body = JSON.stringify(opts.query);
opts.query = {};
}
return $fetch(request, {
baseURL: runtimeConfig.public.apiUrl,
headers:{
'Accept':'application/json',
'Content-Type':'application/json',
'api-id': RTConfig.apiID,
'api-key': RTConfig.apiKEY,
},
...opts
})
}
await useApiFetch("/remote-url")
.then((response)=>{
//logic
})
.catch((error)=>{
// error
});
module.exports = {
apps : [
{
name: "Krym-Tavrida.ru",
script: "npm",
args: "run start",
cwd:"/var/www/yaltaprim/data/www/krym-tavrida.ru/front"
},
{
name: "Yalta-Prim.ru",
script: "npm",
args: "run start",
cwd:"/var/www/yaltaprim/data/www/yalta-prim/resources/front",
}
]};