Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/carusel02/web-server
PCOM-tema3
https://github.com/carusel02/web-server
c clients json sockets webserver
Last synced: 6 days ago
JSON representation
PCOM-tema3
- Host: GitHub
- URL: https://github.com/carusel02/web-server
- Owner: Carusel02
- Created: 2023-05-20T13:02:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-19T14:09:12.000Z (10 months ago)
- Last Synced: 2024-07-07T14:39:21.005Z (6 months ago)
- Topics: c, clients, json, sockets, webserver
- Language: C
- Homepage:
- Size: 343 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PCOM Web Client
### Implementation:
- Started with laboratory 9 HTML skeleton for request composition files.
- Used recommended JSON library for managing objects.
### Defined functions:
`extract_cookie`: extract received cookie.`extract_token`: extract received token.
`create_user`: create JSON for user info.
`create_book`: create JSON for book info.
`notification_client`: notify client based on input.
### Main function reads user commands and executes corresponding actions:
`REGISTER`: POST request to register user.
`LOGIN`: POST request to login.
`ENTER_LIBRARY`: GET request with login cookie to enter library.
`GET_BOOKS`: GET request with token to retrieve books.
`GET_BOOK`: GET request with token and book ID to retrieve specific book.
`ADD_BOOK`: POST request with token to add a book.
`DELETE_BOOK`: DELETE request with token and book ID to delete a book.
`LOGOUT`: GET request to logout and invalidate cookie/token.
`EXIT`: Program termination.
- Used enum to control user states: not logged in, logged in, in library.