Skip to content
This repository has been archived by the owner on Aug 31, 2024. It is now read-only.

Commit

Permalink
Add some more info
Browse files Browse the repository at this point in the history
  • Loading branch information
An-Unnamed-Developer authored Feb 20, 2024
1 parent 0d8c12a commit fbf93e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ Special chatting app made in Electron for the ArcOS team.

It connects to the server using the `config.js` file located in `src/`, and then checks whether you have a token saved. If you have a token, it asks the server for information of the user that is associated with that token, by requesting `/usrget` with the request header `token`. If you haven't got a token saved, it prompts the login, where when the user has entered details, it sends a request to `/login`, with the request headers `user` and `pwd` which should return a token if successful, 403 if unsuccessful. When sending a message, it gets the token and sends a request to `/getmsgs` with the request headers `token`, `community` (can safely be assumed as 0 for now), and `channel` (which can also be assumed as 1 as of right now, but should be implemented ready for multi-channel support). The messages should be returned as JSON, as `{"user":user,"time":timestamp,"text":message}\\<next message>` When sending a message, the program makes a POST request to `/sendmsg` with headers `token`, `community`, `channel` and `message`. This message is JSON like the `/getmsg`.

# Future changes

I hope to implement Socket.IO for better communication instead of sending a HTTP request every 100ms, even if it turns out to be efficient, because the way the messages are assembled is odd, and if someone put "\\" in their message the entire app would crash. I'll fix this later by replacing "\" with special character codes. Probably.

Hopefully this is useful for the backend developers!

0 comments on commit fbf93e2

Please sign in to comment.