# @wisersolutions/koa-serve-client

> Plain Koa middleware for serving the client application

Latest version **0.0.7** (published 2019-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @wisersolutions/koa-serve-client
pnpm add @wisersolutions/koa-serve-client
yarn add @wisersolutions/koa-serve-client
bun add @wisersolutions/koa-serve-client
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2019-11-28 |
| First published | 2018-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Wiser Solutions Inc. |
| Maintainers | dotexe0, hon2a, mcarlotta |

## Links

- npm: https://www.npmjs.com/package/@wisersolutions/koa-serve-client
- Repository: https://github.com/WiserSolutions/koa-serve-client
- Homepage: https://github.com/WiserSolutions/koa-serve-client#readme
- Issues: https://github.com/WiserSolutions/koa-serve-client/issues
- npm.io page: https://npm.io/package/@wisersolutions/koa-serve-client

## Dependencies (3)

- [koa-router](https://npm.io/package/koa-router.md) ^7.4.0
- [koa-static](https://npm.io/package/koa-static.md) ^4.0.3
- [koa-compose](https://npm.io/package/koa-compose.md) ^4.1.0

## Recent versions

- 0.0.7 (latest) — 2019-11-28
- 0.0.6 — 2019-08-27
- 0.0.5 — 2019-07-12
- 0.0.4 — 2019-06-05
- 0.0.3 — 2018-10-08
- 0.0.2 — 2018-10-03
- 0.0.1 — 2018-10-03

## README

# koa-serve-client

Plain Koa middleware for serving the client application

## Installation

In your quadro project install dependency

`npm install @wisersolutions/koa-serve-client`

## Use

Add the middleware to Koa server:

```javascript
const { serveClient } = require('@wisersolutions/koa-serve-client')
const koa = /* ... create or get your server instance ... */
koa.use(serveClient({
  //rootDir: resolve('./'),
  //staticDir: resolve(rootDir, './static'),
  //distDir: resolve(rootDir, './dist'),
  //indexFile: resolve(distDir, './index.html'),
  //exclude: ::/^\/(?:static|api)\//.test,
  //log: ::console.log
}))
```

By default it serves:

- all content of `./static` under `/static`
- all content of `./dist` at root
- the index file for everything else except for `/static/*` and `/api/*` requests

## Development

### Install

Install dependencies using:

```sh
npm install
```

### Develop

After you modify sources, run the following (or set up your IDE to do it for you):

- format the code using `npm run format`
- lint it using `npm run lint`
- test it using `npm test`

and fix the errors, if there are any.

### Publish

Publishing is done in two steps:

1. Create a new version tag and push it to the repository:
    ```sh
    npm version <patch|minor|major>
    git push --follow-tags
    ```
1. Build and publish the new version as a npm package:
    ```sh
    npm publish --access public
    ```

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