import fetch from 'isomorphic-fetch';
const headers = {
'Accept': '/',
'Content-Type': 'application/json',
'Authorization': 'Api-Key secret_live_nwVOyxh4.PguuHThYGgIrpaoJkZnCM1YODsXDKnUh'
};
export default {
createUser: async (userId) => {
try {
const response = await fetch(${process.env.ADAPRY_API_URL}/profiles, {
method: 'POST',
headers,
body: JSON.stringify({customer_user_id: userId})
});
if (response.status !== 200) {
return [adapty api create user error, status: ${response.status}, null];
}
const result = await response.json();
console.log('result: ', result);
return [null, result];
} catch (e) {
return [
createUser: ${e.message}
, null];
}
} ....
Hi, here is code writen in node js, and getting 404 error