# express-http-server

> NodeJS dataverse express http server

Latest version **1.0.13** (published 2024-11-27) · ISC license · 0 weekly downloads

## Install

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

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.13 |
| Published | 2024-11-27 |
| First published | 2024-02-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 15 |
| Unpacked size | 98.4 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Byteverse |
| Maintainers | anokhi0895 |
| Keywords | http, express, winston, yamljs |

## Links

- npm: https://www.npmjs.com/package/express-http-server
- Repository: https://github.com/anokhimg/common-nodejs-components
- Homepage: https://github.com/anokhimg/common-nodejs-components/packages/express-http-server#readme
- Issues: https://github.com/anokhimg/common-nodejs-components/issues
- npm.io page: https://npm.io/package/express-http-server

## Dependencies (15)

- [cors](https://npm.io/package/cors.md) ^2.8.5
- [helmet](https://npm.io/package/helmet.md) ^4.6.0
- [yamljs](https://npm.io/package/yamljs.md) ^0.3.0
- [express](https://npm.io/package/express.md) ~4.18.2
- [crypto-js](https://npm.io/package/crypto-js.md) ^4.2.0
- [http-status](https://npm.io/package/http-status.md) ^1.5.0
- [cookie-parser](https://npm.io/package/cookie-parser.md) ~1.4.4
- [commonjs-errors](https://npm.io/package/commonjs-errors.md) ^1.0.0
- [commonjs-logger](https://npm.io/package/commonjs-logger.md) ^1.0.0
- [express-winston](https://npm.io/package/express-winston.md) ~4.2.0
- [@types/crypto-js](https://npm.io/package/@types/crypto-js.md) ^4.2.2
- [swagger-ui-express](https://npm.io/package/swagger-ui-express.md) ^4.1.6
- [express-forward-error](https://npm.io/package/express-forward-error.md) ^1.0.0
- [express-jwt-validator](https://npm.io/package/express-jwt-validator.md) ^1.0.0
- [express-openapi-validator](https://npm.io/package/express-openapi-validator.md) ^4.13.8

## Alternatives

- [monaco-yaml](https://npm.io/package/monaco-yaml.md) — 420.1K weekly downloads
- [@crewx/workflow](https://npm.io/package/@crewx/workflow.md) — 3.1K weekly downloads
- [yaml-cat](https://npm.io/package/yaml-cat.md) — 38 weekly downloads
- [nunjucks-in-yaml](https://npm.io/package/nunjucks-in-yaml.md) — 9 weekly downloads
- [shopify-symlinks](https://npm.io/package/shopify-symlinks.md) — 3 weekly downloads

## Recent versions

- 1.0.13 (latest) — 2024-11-27
- 1.0.12 — 2024-07-05
- 1.0.11 — 2024-05-31
- 1.0.10 — 2024-05-31
- 1.0.9 — 2024-05-31
- 1.0.8 — 2024-04-10
- 1.0.7 — 2024-04-09
- 1.0.6 — 2024-04-09
- 1.0.5 — 2024-04-09
- 1.0.4 — 2024-04-09
- 1.0.3 — 2024-03-08
- 1.0.2 — 2024-03-08
- 1.0.1 — 2024-02-28
- 1.0.0 — 2024-02-21

## README

# `express-http-server`

Express http server for initializing middleware, error handlers, routes, openapi validator and logger.

## Config

| Name                                        | Description                                                           |
| ------------------------------------------- | --------------------------------------------------------------------- |
| router                                      | Base routes to initialize in the server                               |
| openapiBaseSchema                           | Path to OpenAPI specification yaml file                               |
| env                                         | Control logging and stack inclusion in error responses                |
| ignoredAccessLogPaths                       | URL path fragments to be excluded from the access logs                |


For logger configuration properties see the
[logger documentation](https://gitlab.byteprophecy.accenture.com/dataverse/common-nodejs-components/blob/develop/packages/logger/README.md)


## Usage

```typescript

import { App } from 'express-http-server';

/**required env values */
const appConfig = {
  /** base routes to initialize in the server */
  router: routers,  

  /** logger configuration */
  logger: { logLevel: 'debug', logStyle: 'cli', appName: 'nodejs-commons', moduleName: 'App' },
  ignoredAccessLogPaths: '',

  /** path to openapi swagger file */
  openapiBaseSchema: 'src/openapi/api.schema.yml',

  /** environment(development/test/prod) */  
  env: 'development',

  /** function which allows you to register custom body parsers */
  customBodyParser: (app: Express) => app.use(express.json()),
};

/** initializing the server */
export const app = new App(appConfig).init();

```

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