Keywords: Node.js, Express, Mongodb, JWT token, Socket.io and RestAPI.
FE22 KYH Group Chit Chat
-
Josefine Li Högberg
-
Erica Eklund
The backend contains the following endpoints.
-
[GET] - http://address:port/ducks/api/channel/ <-- retrieves a list of commercial channels
-
[GET] - http://adress:port/ducks/api/channel/:id <-- retrieves the messages of an identified channel.
-
[PUT] - http://address:port/ducks/api/channel/ <-- creates a new channel.
-
[POST] - http://address:port/ducks/api/channel/:id <-- create a new message to an identified channel.
-
[DELETE] - http://address:port/ducks/api/channel/:id <-- deletes an identified channel.
-
[GET] - http://adress:port/ducks/api/broadcast/ <-- retrieves a list of all emergency messages that have been broadcast, e.g.traffic accidents, etc.
-
[POST] - http://address:port/ducks/api/broadcast/ <-- creates a new emergency message by admin.
Some code examples in the server.js, router.js, mongoClient.js and jwtUtil.js