GithubHelp home page GithubHelp logo

percenuage / redcactus Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 233 KB

Simple server status for Express Middleware

License: MIT License

JavaScript 100.00%
middleware express-middleware nodejs status git uptime version commit stats

redcactus's Introduction

Redcactus

Simple server status for Express Middleware

Developed with โค by Percenuage.

Installation

$ npm install --save redcactus

Usage

  1. Edit your express application like this:
const express = require('express');
const status = require('redcactus');
const app = express();

app.use('/status', status());

app.listen(3000);
  1. Start your server with npm start or equivalent

  2. You can access to your server status at localhost:3000/status.

  3. Enjoy!

See status example:

{
  "server": {
    "status": "up",
    "name": "redcactus",
    "version": "1.0.0",
    "description": "Simple server status for Express Middleware",
    "started_at": "2019-11-17T17:43:19+01:00",
    "uptime": 3,
    "uptime_human": "a few seconds ago"
  },
  "git": {
    "sha": "e377f30",
    "branch": "master",
    "subject": "Implement foo",
    "author": {
      "name": "John Doe",
      "email": "[email protected]"
    }
  }
}

Important Notes

In order to access to your package.json, I suppose it locate in your root directory (in the most cases). So I'm using process.cwd() to know to your root path of your npm project.

If you run your project from a different directory where there is your package.json, it may not work properly.

Test

$ npm i && npm test

Contribute

I will be happy to know your suggestions to improve this package :)

redcactus's People

Contributors

dependabot[bot] avatar percenuage avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.