Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ffxsam/meteor-galaxy-maintenance
Galaxy maintenance tracking for Meteor
https://github.com/ffxsam/meteor-galaxy-maintenance
Last synced: 30 days ago
JSON representation
Galaxy maintenance tracking for Meteor
- Host: GitHub
- URL: https://github.com/ffxsam/meteor-galaxy-maintenance
- Owner: ffxsam
- Created: 2017-01-20T07:04:47.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-24T07:33:25.000Z (almost 8 years ago)
- Last Synced: 2024-11-11T15:38:05.371Z (2 months ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# galaxy-maintenance
A package for Meteor that will set up an API endpoint to accept Galaxy status/maintenance updates.
## Installation & Setup
Install the package:
$ meteor add ffxsam:galaxy-maintenance
Go to the [Galaxy status page](http://status.meteor.com) and click the "Subscribe to Updates" button. Click the `<>` symbol (webhooks), and enter your app's base URL, followed by `/api/galaxyStatus`, e.g.:
https://app.mymeteorapp.com/api/galaxyStatus
Once complete, status updates will hit the API endpoint and data will be stored in the `galaxyIncidents` Mongo collection.
## Usage
To reference the maintenance data, you'll need to subscribe to the appropriate publication and fetch the data. Below is an example of a Meteor/React container that would serve up status information to a child component:
```js
import { Meteor } from 'meteor/meteor';
import { createContainer } from 'meteor/react-meteor-data';
import { GalaxyIncidents } from 'meteor/ffxsam:galaxy-maintenance';
import MyComponent from './MyComponent';export default createContainer(() => {
Meteor.subscribe('galaxyIncidents');return {
incidents: GalaxyIncidents.find().fetch(),
}
}, MyComponent)
```A typical document in `galaxyIncidents` might look like this:
```json
{
"_id" : "9kR7rqwuc8sXAHTRw",
"impact" : "maintenance",
"incidentId" : "n032xwhnw4nl",
"scheduledFor" : ISODate("2016-10-17T21:30:00.000-0700"),
"scheduledUntil" : ISODate("2016-10-18T00:30:00.000-0700"),
"status" : "in_progress",
"updatedAt" : ISODate("2016-10-17T21:31:04.976-0700")
}
```When Galaxy (StatusPage, actually) sends out an update with a status of `"completed"`, the incident in question will automatically be removed from the collection.
### Subscribe Options
The `galaxyIncidents` collection will always contain incidents for both US and EU regions. You can limit the region by specifying it when subscribing to the publication:
```js
Meteor.subscribe('galaxyIncidents', { region: 'EU' }); // or 'US'
```## Caveats
This seems to not work when added to a project that uses `meteorhacks:picker`. This might also apply to other REST API packages. When in doubt, use Meteor's built-in `webapp` package which plays nicely with this one.
## Contributing
Please feel free to contribute and improve this package!