h2io-express-server
v0.1.0
Published
Express server setup module used inside H2io modules
Downloads
2
Readme
H2io - Express server setup
Installation
npm install h2io-express-server
Usage
import {
middleware,
setupHttp,
setupHttps,
} from 'h2io-express-server';
// Express
import express from 'express';
const app = express();
// Use all middlewares
app.use(...middleware);
const config = {
hostname: '0.0.0.0',
port: 8080,
}
// Http instance
const http = setupHttp(config, app);
const config = {
hostname: '0.0.0.0',
port: 8080,
ssl: {
path: './ssl',
key: 'ssl.key',
cert: 'ssl.crt',
ca: 'ssl.ca',
},
}
// Https instance
const https = setupHttps(config, app);