Module

StreamController

This controller is in charge of handling requests relating to streams

View Source backend/controllers/streamController.js, line 1

Methods

# static acceptRequestToJoin()

Rejects a request to join stream from a user
Parameters:
Name Type Description
req.body.data * data of the request we want to reject

View Source backend/controllers/streamController.js, line 326

# static closeStream()

Closes the user's stream if one exists (and if user exists)

View Source backend/controllers/streamController.js, line 204

# static createStream()

Tries to create a new stream using the streamData and redirects to newly created page upon success Note: This will fail if now user is signed in/ or the user already has a current stream It adds a new stream to the current user, adds the stream to the database, and notifies all the user's followers That he created a new stream.
Parameters:
Name Type Description
req.body * the stream Data

View Source backend/controllers/streamController.js, line 32

# static getStreamById()

Parameters:
Name Type Description
req.body.streamId * the id of the stream

View Source backend/controllers/streamController.js, line 132

# static getStreamsByStatus()

Finds all streams with a given status
Parameters:
Name Type Description
req.body.page * what page to request
req.body.status * stream status

View Source backend/controllers/streamController.js, line 182

# static rejectRequestToJoin()

Rejects a request to join stream from a user
Parameters:
Name Type Description
req.body.data * data of the request we want to reject

View Source backend/controllers/streamController.js, line 270

# static requestToJoinStream()

Sends a request from currently logged in user to join a stream Note: Requests are cached and are limited to one request per user every 2 minutes
Parameters:
Name Type Description
req.body.data * formatted data of the current user (which is verified in the backend)
req.body.creatorId * Id of the creator to send request to

View Source backend/controllers/streamController.js, line 227

string describing error if failed, otherwise a request is sent

# static searchStreams()

Searches all streams split to pages by a search string Searches tags/description/name
Parameters:
Name Type Description
req.body.searchString * string to search
req.body.page * what page to request
req.body.status * stream status

View Source backend/controllers/streamController.js, line 154

# inner addStreamer(streamId, streamerData)

Parameters:
Name Type Description
streamId * id of the streamer
streamerData * data of the streamer

View Source backend/controllers/streamController.js, line 309