1.0.8 • Published 4 years ago

management_subdomain v1.0.8

Weekly downloads
1
License
MIT
Repository
bitbucket
Last release
4 years ago

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

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago