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

A configurable gateway for development and production.

  • 0.1.15
  • Source
  • npm
  • Socket score

Version published
Maintainers
7
Created
Source

Makeflow Gateway

A configurable gateway for development and production.

Usage

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

// development

const KOA_KEYS = ['dev'];

const gateway = new Gateway({
  keys: KOA_KEYS,
  listen: {
    port: 8080,
  },
  session: {
    rolling: true,
  },
  targets: [
    {
      type: 'proxy',
      match: '/app/api',
      base: 'http://localhost:8081',
    },
    {
      type: 'proxy',
      match: '/app',
      base: 'http://localhost:8082',
    },
    {
      type: 'proxy',
      match: '/api',
      base: 'http://localhost:8061',
    },
    {
      type: 'proxy',
      match: '',
      base: 'http://localhost:8062',
    },
  ],
});

// production

const KOA_KEYS = ['some secrets'];

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

gateway.serve();

License

MIT License.

FAQs

Package last updated on 08 Dec 2021

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