카테고리 없음
Til (2023.02.16)
온라인 오프라인 전환 온라인 오프라인 공유를위해 dbjson에 온라인 정보를 저장하는 방식을 사용했다. 백엔드가 가능하면 더 나은 방법이 있을 것 같지만 dbjson만으로 생각해본 방법은 이거였다. 우선 polling을 이용해 로그인 한사람의 타임스탬프를 30초마다 찍어준다. // 타임스탬프 찍어주기 const dataApi = async () => { const rankApi = () => axios .get(`http://localhost:3001/auth/${ProfleSteamId}`) .then((response) => { const i = response.data; axios.put(`http://localhost:3001/auth/${ProfleSteamId}`, { ...i, lastLog..