Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/josudoey/koa4listen
provide a function for create http or https server to listen.
https://github.com/josudoey/koa4listen
Last synced: about 1 month ago
JSON representation
provide a function for create http or https server to listen.
- Host: GitHub
- URL: https://github.com/josudoey/koa4listen
- Owner: josudoey
- Created: 2017-02-09T15:11:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-09T15:49:03.000Z (almost 8 years ago)
- Last Synced: 2024-11-30T10:08:40.289Z (about 1 month ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# koa4listen
## Installation
```bash
$ npm install --save koa4listen
```## Example
```js
var createServer = require('koa4listen');
var opts = require('cert4https');
var app = require('koa')();
var server = createServer(app, opts);
server.on('listening', function () {
var web_listen = server.address().address + ':' + server.address().port;
console.log('service listein on ' + web_listen);
});
server.listen(3000);
```