0.0.3 • Published 10 months ago

replit.uptimer v0.0.3

Weekly downloads
-
License
BSD-2-Clause
Repository
-
Last release
10 months ago

replit.uptimer Ready

replit.uptimer is an npm package designed to help keep your Replit projects online by monitoring their uptime and automatically creating an API.

Installation

To install replit.uptimer, run the following command:

# NPM
npm add replit.uptimer
# Bun.js
bun add replit.uptimer
# Yarn
yarn add replit.uptimer

Usage

Replit.Uptimer can be used in your Replit projects to monitor their uptime and automatically create an API. Here is an example of how to use it:

import { UptimeNow } from "replit.uptimer";
/*
 //CJS
 const { UptimeNow } = require("replit.uptimer")
*/

UptimeNow();

Preload

  • If you do this, you do not need to write a callback, the package will be called in advance
node -r replit.uptimer/start index.js

Here's an example of a .replit file. Modify it to this content.

  • .replit
run = "node -r replit.uptimer/start index.js"

[nix]
channel = "stable-22_11"

Note

By default, replit.uptimer will monitor the project's uptime every 50 seconds and create an API that returns a JSON object with the project's title, description, and URL. You can customize the configuration by creating a uptime.config.json file in your project's root directory. Here is an example of the default configuration:

{
  "debug": false,
  "create_api": true,
  "port": 3000,
  "path": "/"
}

You can modify any of these properties to customize the behavior of replit.uptimer.

License

Refer to the LICENSE file.

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago