npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kobionic/node-config-server

v1.5.0

Published

Centralized configuration server providing a dynamic RESTful API, allowing retrieval of entire files content or their parsed properties.

Downloads

14

Readme

Node Config Server

npm version Build Status Dependencies Status DevDependencies Status License

Centralized configuration server providing a dynamic RESTful API, allowing retrieval of entire files content or their parsed properties.

Installation

The Node Config Server project is deployed both on npm & the Docker Hub. Choose which type of installation meets your requirements and follow the appropriate procedure as described below.

npm

npm install --global @kobionic/node-config-server

Docker

Using plain-old Docker command

docker run -d --name node-config-server kobionic/node-config-server

The image basically exposes port 20490, therefore container links will make it available to the linked containers.

If you want to make it available to services running on your host, use the -p options to publish the port on your host:

docker run -d -p 20490:20490 --name node-config-server kobionic/node-config-server

Using Docker Compose

With Docker Compose, configuration is as easy as writing a docker-compose.yml file such as:

version: '3'

services:
  node-config-server:
    image: 'kobionic/node-config-server'
    container_name: 'node-config-server'
    restart: 'always'
    ports:
      - '20490:20490'
    volumes:
      - '/path/to/your/config:/app/config:ro'

Configuration

Configuration of the application is done using environment variables. You can find a list of all available variables by reading this documentation a little bit further.

Configure with Docker Compose

Configuring the application with Docker Compose only requires adding an environment array to your docker-compose.yml file.

As an example, if you would like to set the maximum number of forks to create when instantiating the server to 2 and add a correlation ID to the logger, you need to add this to your docker-compose.yml file:

environment:
  CPUS_NUMBER: 2
  LOG_PRINT_ID: 'true'

Configure by setting OS environment variables

Let's use the example above again and set CPUS_NUMBER to 2 and LOG_PRINT_ID to true using environment variables, both on Linux & Windows.

On Linux

export CPUS_NUMBER=2
export LOG_PRINT_ID=true

On Windows

set CPUS_NUMBER=2
set LOG_PRINT_ID=true

Environment variables

Numerous environment variables can be set to configure the application.

| Variable | Type | Default | Description | | -------------------- | ------- | ------------------ | ------------------------------------------------------------------------ | | PORT | number | 20490 | the port the server will listen on | | CPUS_NUMBER | number | OS core number | number of servers to instantiate using the Node.js cluster API | | LOG_DIR | string | ./logs | log file directory | | LOG_LEVEL | string | info | set the logging level ( debug | error | info | none ) | | LOG_NAME | string | node-config-server | log file name | | LOG_PRINT_ID | boolean | false | if set to true, will add a correlation ID to the logging output | | NODE_CONFIG_DIR | string | ./config | base directory where served files will be looked for | | EUREKA_CLIENT | boolean | false | the server will try to register to an Eureka server if set to true | | EUREKA_SERVER_HOST | string | localhost | configures the Eureka server hostname | | EUREKA_SERVER_PORT | number | 8761 | configures the Eureka server port number |

Authors

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.