This package has been deprecated

Author message:

Merged to alp-node

alp-listen
TypeScript icon, indicating that this package has built-in type declarations

7.1.1 • Public • Published

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-node-config';
import errors from 'alp-errors';
import logger from 'alp-logger';
import listen from 'alp-listen';

const app = new Koa();
config(new URL('./config', import.meta.url), { packageConfig })(app);
logger(app);

app.use(errors);

listen(new URL('../cert', import.meta.url))(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

Readme

Keywords

Package Sidebar

Install

npm i alp-listen

Weekly Downloads

39

Version

7.1.1

License

ISC

Unpacked Size

25 kB

Total Files

10

Last publish

Collaborators

  • churpeau