# organic-express-server

> Organelle constructing expressjs app and opening http server listening port

Latest version **1.0.0** (published 2018-11-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install organic-express-server
pnpm add organic-express-server
yarn add organic-express-server
bun add organic-express-server
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-11-25 |
| First published | 2014-07-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Boris Filipov |
| Maintainers | outbounder |

## Links

- npm: https://www.npmjs.com/package/organic-express-server
- Repository: https://github.com/outbounder/organic-express-server
- Issues: https://github.com/outbounder/organic-express-server/issues
- npm.io page: https://npm.io/package/organic-express-server

## Recent versions

- 1.0.0 (latest) — 2018-11-25
- 0.1.0 — 2017-06-13
- 0.0.2 — 2014-10-20
- 0.0.1 — 2014-07-10

## README

# organic-express-server

Organelle constructing expressjs app and opening http server listening port

## dna

    "organic-express-server": {
      "source": "node_modules/organic-express-server",
      "port": 1337, // (Number) if 0 is defined = listen to random port assigned by the OS
      "host": "127.0.0.1", // (String) if not defined = listen to all interfaces. https://nodejs.org/api/http.html#http_server_listen_port_hostname_backlog_callback
      "backlog": 511, // (Number) maximum length of the queue of pending connections. The actual length will be determined by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn` on Linux. The default value of this parameter is 511 (not 512). https://nodejs.org/api/http.html#http_server_listen_port_hostname_backlog_callback
      "log": true,
      "initScript": "init-express-app",
      "emitReady": "ExpressServer",
      "closeOn": "kill",
      "forceConnectionsDestroyOnClose": false
    }

### `initScript` property

Optional, if provided will `require` given module using `process.cwd`+`initScript` as path.
Example module:

    module.exports = function(plasma, dna, next) {
      var app = express()
      next(err, app)
    }

Invoking `next(err, app)` will complete express server initialization by start listening for incoming requests and emit ready chemical.

### `logRunning` property

Optional, if provided will `console.log` when express server is listening for incoming requests.

### `forceConnectionsDestroyOnClose` property

Optional, if enabled on `kill` chemical all opened connections will be destroyed and server closed, otherwise the server will close when there are no longer open connections.

## `emitReady` chemical
Emitted once express server is listening for incoming requests

    {
      type: `emitReady value`,
      data: expressApplication,
      server: httpServer
    }

## `kill` chemical
Once received will close underlaying httpServer

---
_Source: https://npm.io/package/organic-express-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
