# @supergeneric/express

> Minimally configured Express.js server

Latest version **0.5.0** (published 2019-11-06) · MIT license · 0 weekly downloads

## Install

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

## 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.5.0 |
| Published | 2019-11-06 |
| First published | 2019-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.0.0 |
| Dependencies | 13 |
| Unpacked size | 21.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kevin R. Whitley |
| Maintainers | krwhitley |

## Links

- npm: https://www.npmjs.com/package/@supergeneric/express
- Repository: https://github.com/supergeneric/express
- Issues: https://github.com/supergeneric/express/issues
- npm.io page: https://npm.io/package/@supergeneric/express

## Dependencies (13)

- [cors](https://npm.io/package/cors.md) ^2.8.5
- [faker](https://npm.io/package/faker.md) ^4.1.0
- [dotenv](https://npm.io/package/dotenv.md) ^6.2.0
- [helmet](https://npm.io/package/helmet.md) ^3.18.0
- [morgan](https://npm.io/package/morgan.md) ^1.9.1
- [express](https://npm.io/package/express.md) ^4.16.4
- [apicache](https://npm.io/package/apicache.md) ^1.5.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^8.1.0
- [deepmerge](https://npm.io/package/deepmerge.md) ^4.0.0
- [compression](https://npm.io/package/compression.md) ^1.7.3
- [supergeneric](https://npm.io/package/supergeneric.md) ^1.1.0
- [cookie-parser](https://npm.io/package/cookie-parser.md) ^1.4.4
- [express-session](https://npm.io/package/express-session.md) ^1.16.2

## Recent versions

- 0.5.0 (latest) — 2019-11-06
- 0.5.0-next.0 (next) — 2020-01-09
- 0.4.0 — 2019-11-04
- 0.3.0 — 2019-09-03
- 0.2.0 — 2019-09-03

## README

A simplified Express.js environment to serve server + client code.
#### Supports Redis or built-in memory engine with auto-clearing.

# Includes
- [x] gzip compression
- [x] body parsing for form data
- [x] favicon serving
- [x] sessions
- [x] cookies
- [ ] authentication

# Installation
```bash
yarn add @arundo/adk-express
```

# Usage
```js
/* import un-instantiated express app from our starter kit...
   this is a full-fledged express app, ready to accept middleware,
   plugins, routers, etc.  We've added the .start() method to fire
   up the server directly, although you could always start it any other way
   you like.
*/
import express from '@arundo/adk-express'

const app = express()

app.start({
  useClient: true, // defaults to true to route all paths to client-side index.html
}) // custom start() method, launches http listener
```

Env vars supported:

```sh
PORT=3000
NODE_ENV=production
```

# Examples
### Usage with custom API

###### index.js
```js
import express from '@arundo/adk-express'
import api from './api'

const app = express()

app.use('/api', api)

app.start() // custom start() method, launches http listener
```

###### api.js
```js
import express from 'express'

const app = express()

// example route... will be callable from /api/foo
app.get('/foo', (req, res) => {
  res.json({
    success: true,
    path: req.path,
  })
})

export default app
```

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