Socket
Socket
Sign inDemoInstall

@bayerjs/mount

Package Overview
Dependencies
65
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @bayerjs/mount

Mount Bayer.js apps and middlewares into sub-directories


Version published
Weekly downloads
1
Maintainers
1
Install size
12.2 MB
Created
Weekly downloads
 

Readme

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

Last updated on 15 Mar 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc