Skip to content
This repository has been archived by the owner. It is now read-only.
Listen function, using config and logger for alp server
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
src
.editorconfig
.eslintignore
.eslintrc.json
.gitignore
.npmignore
.yo-rc.json
AUTHORS
CHANGELOG.md
LICENSE
README.md
README.md.back
index.js
package.json
yarn.lock

README.md

alp-listen

Listen function, using config and logger for alp server

Install

npm install --save alp-listen

Usage

import Koa from 'koa';
import config from 'alp-config';
import errors from 'alp-errors';
import logger from 'alp-logger';
import listen from 'alp-listen';

const app = new Koa();
config(`${__dirname}/config`, { packageConfig })(app);
logger(app);

app.use(errors);

listen(`${__dirname}/../cert/`)(app).then((server) => {
    console.log('Listening !');
});

config:

  • socketPath OR port (+ hostname)
  • tls: boolean

If tls is true, the files server.key and server.crt will be loaded from the path given in the first param

You can’t perform that action at this time.