Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@makeflow/gateway

Package Overview
Dependencies
Maintainers
7
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@makeflow/gateway

[![NPM version](https://img.shields.io/npm/v/@makeflow/gateway?color=%23cb3837&style=flat-square)](https://www.npmjs.com/package/@makeflow/gateway) [![Repository package.json version](https://img.shields.io/github/package-json/v/mufancom/gateway?color=%23

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
7
Weekly downloads
 
Created
Source

NPM version Repository package.json version MIT License Discord

Makeflow Gateway

A configurable gateway for development and production.

Usage

import {
  Gateway,
  createIndexFileFallbackMatchPathRegex,
} from '@makeflow/gateway';

// development

const gateway = new Gateway({
  listen: {
    port: 8080,
  },
  targets: [
    {
      type: 'proxy',
      match: '/app/api',
      target: 'http://localhost:8081{path}',
    },
    {
      type: 'proxy',
      match: '/app',
      target: 'http://localhost:8082{path}',
    },
    {
      type: 'proxy',
      match: '/api',
      target: 'http://localhost:8061{path}',
    },
    {
      type: 'proxy',
      match: '',
      target: 'http://localhost:8062{path}',
    },
  ],
});

// production

const gateway = new Gateway({
  listen: {
    port: 8080,
  },
  targets: [
    {
      type: 'proxy',
      match: '/app/api',
      target: 'http://makeflow-app-server:8081{path}',
    },
    {
      type: 'file',
      match: createIndexFileFallbackMatchPathRegex('/app'),
      target: Path.join(__dirname, '../../static/app/index.html'),
    },
    {
      type: 'file',
      match: '/app',
      target: Path.join(__dirname, '../../static/app{path}'),
    },
    {
      type: 'proxy',
      match: '/api',
      target: 'http://makeflow-community-site-server:8061{path}',
    },
    {
      type: 'file',
      match: createIndexFileFallbackMatchPathRegex(),
      target: Path.join(__dirname, '../../static/site/index.html'),
    },
    {
      type: 'file',
      match: '',
      target: Path.join(__dirname, '../../static/site{path}'),
    },
  ],
});

gateway.serve();

License

MIT License.

FAQs

Package last updated on 14 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc