# @zvs001/express

> Express with minimal shared setup. Also includes some shared middlewares

Latest version **1.3.0** (published 2024-10-21) · 0 weekly downloads

## Install

```sh
npm install @zvs001/express
pnpm add @zvs001/express
yarn add @zvs001/express
bun add @zvs001/express
```

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2024-10-21 |
| First published | 2023-08-06 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 14 |
| Unpacked size | 187.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | zvs001 |
| Keywords | express |

## Links

- npm: https://www.npmjs.com/package/@zvs001/express
- Repository: https://github.com/zvs001/zvs001-express
- Homepage: https://github.com/zvs001/zvs001-express#readme
- Issues: https://github.com/zvs001/zvs001-express/issues
- npm.io page: https://npm.io/package/@zvs001/express

## Dependencies (14)

- [joi](https://npm.io/package/joi.md) ^17.13.3
- [cors](https://npm.io/package/cors.md) ^2.8.5
- [axios](https://npm.io/package/axios.md) ^1.6.8
- [colors](https://npm.io/package/colors.md) ^1.4.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [morgan](https://npm.io/package/morgan.md) ^1.10.0
- [express](https://npm.io/package/express.md) ^5.0.1
- [winston](https://npm.io/package/winston.md) ^3.15.0
- [body-parser](https://npm.io/package/body-parser.md) ^1.20.3
- [http-errors](https://npm.io/package/http-errors.md) ^2.0.0
- [rate-limit-redis](https://npm.io/package/rate-limit-redis.md) ^4.2.0
- [express-rate-limit](https://npm.io/package/express-rate-limit.md) ^7.4.1
- [express-request-id](https://npm.io/package/express-request-id.md) ^1.4.1
- [express-robots-txt](https://npm.io/package/express-robots-txt.md) ^1.0.0

## Recent versions

- 1.3.0 (latest) — 2024-10-21
- 1.2.1 — 2024-06-14
- 1.2.0 — 2024-04-22
- 1.1.0 — 2023-12-21
- 1.0.3 — 2023-12-20
- 1.0.2 — 2023-12-15
- 1.0.1 — 2023-11-29
- 1.0.0 — 2023-11-29
- 0.1.0 — 2023-08-24
- 0.0.6 — 2023-08-17
- 0.0.5 — 2023-08-06
- 0.0.4 — 2023-08-06
- 0.0.3 — 2023-08-06
- 0.0.2 — 2023-08-06
- 0.0.2-rc.1 — 2023-08-06
- … 1 more at https://npm.io/package/@zvs001/express/versions

## README

Express with minimal shared setup. Also includes some shared middlewares

[![npm](https://img.shields.io/npm/v/@zvs001/express)](https://www.npmjs.com/package/@zvs001/express)


## Install

``yarn add @zvs001/express``

## Usage

Configure server
```typescript
import { createServer, createIPRateLimitMiddleWare, createRequestLogger } from '@zvs001/express'
import bodyParser from 'body-parser'
import redisClient from '@libs/redis'

const isTest = process.env.NODE_ENV === 'test'

function createAppServer() {
  const app = createServer()

  app.use(bodyParser.json())

  if (!isTest) app.use(createRequestLogger())

  app.use([
    createIPRateLimitMiddleWare({
      serviceName: 'my-service',
      redisClient,
    }),
  ])

  return app
}

export default createAppServer
```


Apply server
```typescript
import { applyPostMiddleWares } from '@zvs001/express/src/middlewares'
import adminRouter from './api/admin/router'
import createServer from './lib/express/createServer'

const server = createServer()

server.use('/admin', adminRouter)

applyPostMiddleWares(server)
```

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