leaonline:uptime

v1.0.0Published 9 hours ago

Uptime

A simple Meteor package for uptime monitoring integration.

Installation

meteor add leaonline:uptime

Usage

The package is sever-side only. Import and initialize the package in your server code:

1import { Uptime } from 'meteor/leaonline:uptime'
2
3Uptime.init({
4  path: Meteor.settings.uptime.path
5});

This creates a HTTP GET endpoint that returns a simple status message for uptime monitors. Make sure to configure the uptime.path setting in your Meteor settings.json:

1{
2  "uptime": {
3    "path": "/your-monitoring-endpoint"
4  }
5}

The default status is 200, returning the following JSON response:

1{
2  "status": "ok",
3  "available": true,
4  "since": "2026-08-20T10:10:39.211Z"
5}

The since field represents the timestamp of the last change of the status, which is by default the call to Uptime.init.

You can obtain the current status by calling Uptime.getStatus().

To set a new status (for whatever reason) you can call Uptime.getStatus:

1Uptime.setStatus({
2  code: 503,
3  available: false,
4  status: 'unavailable'  
5})

It is advised to use valid http status codes.

License

MIT, see license file