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

multilane

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multilane

Consolidates application frameworks

  • 0.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
Maintainers
1
Weekly downloads
 
Created
Source

Multilane

Consolidates application frameworks

Set up multiple serverless apps with shared resources at highway speed.

Example configuration for app1 and app2 using Express and Koa.

// config.js
apps: {
    all: {
        engines: {
            extensions: {
                html: 'nunjucks',
                hbs: 'handlebars'
            },
            default: 'html',
            options: {},
            requires: {
                nunjucks: require('nunjucks')
            }
        },
    },
    app1: {
        handlers: [
            require('express').static('public'),
            require("./middleware/exp/pre_routes"),
            require("./apps/app1/routes"),
            require("./middleware/exp/post_routes")
        ],
        views: [
            "views",
            "views/apps/app1"
        ],
        settings: {
            "trust proxy": 1
        }
    },
    app2: {
        handlers: [
            require('koa-static')('public'),
            require("./middleware/koa/pre_routes"),
            require("./apps/app2/routes"),
            require("./middleware/koa/post_routes")
        ],
        views: "views"
    }
}

// index.js
const express = require('express')
const Koa = require('koa')

const apps = require('multilane')
const config = require('./config.js')['apps']

const app1 = apps.express(express(), require('consolidate'),
    { ...config['all'], ...config['app1'] },
    { 'example-context': { 'example-param': "args...", ping: () => { return 'pong' } } })

const app2 = apps.koa(new Koa(), require('koa-views'),
    { ...config['all'], ...config['app2'] },
    { 'example-context': { 'example-param': "args..." } })

app1.listen(3001, () => console.log("Started app1"))
app2.listen(3002, () => console.log("Started app2"))

Keywords

FAQs

Package last updated on 20 Jul 2020

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