management_subdomain

1.0.8 • Public • Published

MANAGEMENT EXPRESS APP AND SUBDOMAINS

With this package you can create a http server or https server with express and redirect yours request in many subdomains

Installation

Use the package manager yarn or npm to install the module.

Yarn

yarn add -s management_subdomain

npm

npm i -s management_subdomain

Usage

ES6

import { createServer } from 'management_subdomain'
import { join } from 'path'

// Intance server with absolute path for new folders
const server = createServer({ 
    sites = join(__dirname, 'sites'), // folder for express apps
    ssl = join(__dirname, 'ssl'),  // folder for ssl certificates with names fullchain and privkey.pem
    domainsInfo = [{ folder: "default", url: "test.localhost" }] // name of folder in sites, this contains express app
})

// Server listen on port 80 (http)
server.listenHttp()

// Or listen on port 443 (https)
server.listenHttps()

ES2015

const { createServer } = require('management_subdomain')
const { join } = require('path')

// Intance server with absolute path for new folders
const server = createServer({ 
    sites = join(__dirname, 'sites'), // folder for express apps
    ssl = join(__dirname, 'ssl'),  // folder for ssl certificates with names fullchain and privkey.pem
    domainsInfo = [{ folder: "default", url: "test.localhost" }] // name of folder in sites, this contains express app
})

// Server listen on port 80 (http)
server.listenHttp()

// Or listen on port 443 (https)
server.listenHttps()

License

MIT

/management_subdomain/

    Package Sidebar

    Install

    npm i management_subdomain

    Weekly Downloads

    0

    Version

    1.0.8

    License

    MIT

    Unpacked Size

    9.02 kB

    Total Files

    10

    Last publish

    Collaborators

    • crodriguez_inforser