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

@restorecommerce/facade

Package Overview
Dependencies
Maintainers
5
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@restorecommerce/facade

Facade for Restorecommerce microservices

  • 2.2.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
48
decreased by-73.18%
Maintainers
5
Weekly downloads
 
Created
Source

@restorecommerce/facade

import { createLogger } from '@restorecommerce/logger';
import { createFacade } from '@restorecommerce/facade';
import { exampleModule } from './example-module';

const logger = createLogger(cfg.logger);
const env = process.env.NODE_ENV;

const facade = createFacade({
  port: 5000,
  logger,
  env
}).useModule(exampleModule, { message: 'foo' });

facade.start();

Included 3rd party koa middlewares

  • bodyParser
  • kcors
  • helmet

Provided koa middlewares

Metadata Passing

The facade packages and sends upstream all headers as well as the origin address in the GRPC metadata.

The headers are in a JSON serialized format.

Example:

Metadata({
  'headers': [
      '{"host":"192.168.1.103:5000","user-agent":"Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0","accept":"*/*","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate","referer":"http://192.168.1.103:5000/graphql","content-type":"application/json","content-length":"540","origin":"http://192.168.1.103:5000","connection":"keep-alive"}'
  ],
  'origin-ip': [ '192.168.1.103' ]
})

Keywords

FAQs

Package last updated on 10 Jan 2025

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