rssCloud Server implementation in Node.js
git clone https://github.com/rsscloud/rsscloud-server.git
cd rsscloud-server
npm install
npm start
The API is tested using docker containers. I've only tested on MacOS so if you have experience testing on other platforms I'd love having these notes updated for those platforms.
First install Docker Desktop for Mac
npm run test-api
This should build the appropriate containers and show the test output.
Our tests create mock API endpoints so we can verify rssCloud server works correctly when reading resources and notifying subscribers.
Posting to /pleaseNotify is your way of alerting the server that you want to receive notifications when one or more resources are updated.
The POST parameters are:
When you POST the server first checks if the urls you specifed are returning an HTTP 2xx status code then it attempts to notify the subscriber of an update to make sure it works. This is done in one of two ways.
http://<ip>:<port><path>
with a single parameter url
. To accept the subscription that resource just needs to return an HTTP 2xx status code.http://<domain>:<port><path>
with two query string parameters, url and challenge. To accept the subscription that resource needs to return an HTTP 2xx status code and have the challenge value as the response body.You will receive a response with two values:
The default response type is text/xml but if you POST with an accept header specifying application/json
we will return a JSON formatted response.
Examples:
<?xml version="1.0"?>
<notifyResult success="false" msg="The subscription was cancelled because the call failed when we tested the handler."/>
{"success":false,"msg":"The subscription was cancelled because the call failed when we tested the handler."}
Posting to /ping is your way of alerting the server that a resource has been updated.
The POST parameters are:
When you POST the server first checks if the url has actually changed since the last time it checked. If it has, it will go through it's list of subscribers and POST to the subscriber with the parameter url
.
The default response type is text/xml but if you POST with an accept header specifying application/json
we will return a JSON formatted response.
Examples:
<?xml version="1.0"?>
<result success="true" msg="Thanks for the ping."/>
{"success":true,"msg":"Thanks for the ping."}
The path /pingForm is an HTML form intented to allow you to ping via a web browser.
The path /viewLog is a log of recent events that have occured on the server. It's very useful if you're trying to debug your tools.