badge-server

1.1.0 • Public • Published

badge-server

Simple express server for serving badges

npm

Once running, badges can be generated and retrieved with the URI /:user/:package/:badge, eg /bytesnz/badge-server/npm.

Available Badges

  • npm - npm
  • custom?name=hello&color=lightgrey&value=world - hello

Configuration

The available badges need to be configured in a config.json file that should be located in the current working directory.

/**
 * Definition for the configuration file for badge-server
 * Should be located in the current working directory
 */
export interface Config {
  /// Base URI that badges will be served from. Defaults to /
  baseUri?: string,
  /// Port to listen on. Defaults to 5570
  port?: number,
  /// Hostname to listen on. Default to localhost
  hostname?: string
  /// Log file to write requests to. Default to logging to console
  log?: string,
  /// Badges to serve
  badges: Array<{
    /// Username that owns the repos/packages
    user?: string,
    /// Repo(s)/Package(s) to server badges for. If not given, badges for any
    /// repo/package will be servered. *WARNING* this will mean any package
    /// for NPM badges (as the user is not used by this badge
    repos?: Array<string>,
    /// Badge(s) to serve
    badges?: Array<string>
  }>
}
 
 

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

[1.0.0] - 2018-07-10

Initial Release

Readme

Keywords

Package Sidebar

Install

npm i badge-server

Weekly Downloads

1

Version

1.1.0

License

GPL-3.0

Unpacked Size

46.3 kB

Total Files

10

Last publish

Collaborators

  • bytesnz