<aside> 💡 톡플러스는 인앱 또는 웹에서 SDK 연동으로 채팅을 간단하게 구현 할 수 있는 API 입니다
채팅 인프라 및 기능구현에 시간이 많지 않아 도입하게 됐습니다.
</aside>
...
async send(param: { method: string; url: string; data?: object }) {
const result = {
param,
status: 200,
message: null,
};
try {
await Axios({
responseType: 'json',
method: param.method,
headers: {
'content-type': 'application/json',
'api-key': this.config.TALK_PLUS.API_KEY,
'app-id': this.config.TALK_PLUS.APP_ID,
},
url: param.url,
data: param.data,
});
} catch (e) {
result.status = 500;
result.message = e.code;
} finally {
return result;
}
}
...