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

@medxfactor/dev-mux

v0.4.2

Published

Dynamic CI/CD Development Multiplexer

Downloads

20

Readme

dev-mux

Dynamic CI/CD Development Multiplexer

What is it?

A Dynamic CI/CD Development Multiplexer
     |      |       |            |
     |      |       |            A gateway to running instances
     |      |       It's not fast, and should not be used in production
     |      I personally use it in CI/CD environments for multiple instances
     No need to reloads or restarts. Changes will be applied on the next request

Which problem does it solve?

In CI/CD environments where you might have many Server-Side Rendered (SSR) application instances running on the same machine, and each might listen to a different, and even a random port, popular gateways like nginx will not help much, because they cannot get configured during their runtime and they should be restarted after each change in their configuration.

One solution is to have a gateway which distributes requests it receives to application instances that are attached to it, based on a base URL they are interested in. It launches two servers, one is the gateway itself, which routes the requests to application instances. Other one, is the operation server, which application instances can issue requests to it, for attach/detach operations.

Personally, I want to have the following architecture:

diagram that represent an example scenario where dev-mux works best

[Credit: https://app.diagrams.net/]

So, if you have the same problem, dev-mux might help you! 😃

Usage

npx:

npx @medxfactor/dev-mux

It will start the dev-mux operation server at http://127.0.0.3001 and gateway server at http://127.0.0.3000.

You can change each server host and port by providing options to dev-mux.

Options

Executing dev-mux with --help, will print:


  Dynamic CI/CD Development Multiplexer

  Usage:
    dev-mux [options]

  Options:
    --operation-port          Preferred operation server port.  [default: 3001]
    --operation-host          Preferred operation server host.  [default: '127.0.0.1']
    --gateway-port            Preferred gateway server port.    [default: 3000]
    --gateway-host            Preferred gateway server host.    [default: '127.0.0.1']
    --help, -h                Prints this help message and exists.
    --version, -v             Prints dev-mux version (0.4.2) and exists.

Operation Server Endpoints

Operation server have two endpoints:

  • PUT /attach:

    Used to request for attaching a server to a base URL.

    Example:

    curl \
        --request PUT \
        --url http://localhost:3001/add-me \
        --header 'Content-Type: application/json' \
        --data '{
            "host": "127.0.0.1",
            "port": 8090,
            "listeningUrl": "/send-me"
        }'
  • PUT /detach:

    Used to request for detaching a server from a base URL.

    Example:

    curl \
        --request PUT \
        --url http://localhost:3001/add-me \
        --header 'Content-Type: application/json' \
        --data '{
            "listeningUrl": "/im-listening"
        }'