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

@bayerjs/mount

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bayerjs/mount

Mount Bayer.js apps and middlewares into sub-directories

  • 0.3.0-alpha.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@bayerjs/mount

Mount Bayer.js middlewares into subdirectories.

Usage

import Bayer from "@bayerjs/core";
import mount from "@bayerjs/mount";
import staticFiles from "@bayerjs/static";
const server = new Bayer();
server.use(mount("/static", staticFiles(STATIC_DIR)), 1); // Here we use the static middleware as an example

server.listen(3000);

In the snippet above, the server will respond to requests with a 404 error (the default behavior), but will delegate requests made to /static to the static middleware.

Mounting Bayer applications

Ther Bayer server class exposes a middleware() function that returns a server middleware; you can use this to mount sub-application into subdirectories, and essentially turn them into modules.

Keywords

FAQs

Package last updated on 15 Mar 2019

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