Add password to .env file as AUTH=password
npm install
node app.js
Schema
_id bigserial
mediaLink varchar
infoLink varchar
streamName varchar
schema
_id bigint
// value set to 1
streamId varchar
URL /allstreams
METHOD GET
Success Response 200
;[
{
streamName: 'Malayalam',
mediaLink: 'http://google.com',
infoLink: 'http://google.com',
_id: '1RK50YjlBiZn39TC',
},
{
streamName: 'English',
mediaLink: 'http://google.com',
infoLink: 'http://google.com',
_id: 'P6cfa8q35qPSrqRa',
},
{
streamName: 'Hindi',
mediaLink: 'http://google.com',
infoLink: 'http://google.com',
_id: 'uHdBsxA1Tnyj7pco',
},
]
Error Response
500
Internal error
URL /streamurl
METHOD GET
Success Response 200
{
"streamName": "English",
"mediaLink": "http://google.com",
"infoLink": "http://google.com",
"_id": "P6cfa8q35qPSrqRa"
}
Error Response
500
Internal error
URL /setactivestream
METHOD POST
HEADER Authorization: passowrd
Body
{
"_id": "5lieE8sc1hB5kTip"
}
Success Response
**200
** Active stream set
Error Response
400
No stream id given
401
No credentials sent
403
Incorrect credentials
500
Internal error
URL /createstream
METHOD POST
HEADER Authorization: passowrd
Body
{
"streamName": "English",
"mediaLink": "http://google.com",
"infoLink": "http://google.com",
}
Success Response 200
{
"streamName": "English",
"mediaLink": "http://google.com",
"infoLink": "http://google.com",
"_id": "5lieE8sc1hB5kTip"
}
Error Response
401
No credentials sent
403
Incorrect credentials
500
Internal error
URL /updatestream
METHOD POST
HEADER Authorization: passowrd
Body
{
"_id": "5lieE8sc1hB5kTip"
"streamName": "English",
"mediaLink": "http://google.com",
"infoLink": "http://google.com",
}
Success Response 200
{
"streamName": "English",
"mediaLink": "http://google.com",
"infoLink": "http://google.com",
"_id": "5lieE8sc1hB5kTip"
}
Error Response
400
No stream id given
404
Stream not found
401
No credentials sent
403
Incorrect credentials
500
Internal error
URL /deletestream
METHOD POST
HEADER Authorization: passowrd
Body
{
"_id": "5lieE8sc1hB5kTip"
}
Success Response
**200
** Stream deleted
Error Response
400
No stream id given
404
Stream not found
401
No credentials sent
403
Incorrect credentials
500
Internal error
Emanuel Christo
😺 GitHub