# express-hapi

> Add a route method to an express app or router to create routes in a similar fashion to hapi.js

Latest version **1.0.1** (published 2016-12-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install express-hapi
pnpm add express-hapi
yarn add express-hapi
bun add express-hapi
```

## 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.1 |
| Published | 2016-12-09 |
| First published | 2016-12-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | w3cj |
| Maintainers | w3cj |

## Links

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

## Recent versions

- 1.0.1 (latest) — 2016-12-09
- 1.0.0 — 2016-12-09

## README

# express hapi

Add a route method to an express app or router to create routes in a similar fashion to hapi.js

## Install

```sh
npm install --save express-hapi
# or
yarn add express-hapi
```

## Usage

```js
const express = require('express');
const expressHapi = require('express-hapi');

const app = express();
expressHapi(app); // Add the route method to app

// Create a route using the added route method
app.route({  
    method: 'GET',
    path: '/',
    handler: (req, res, next) => {
      res.json({
        message: 'I\'m so hapi!'
      });
    }
});

// Above is equivalent to:
app.get('/', (req, res, next) => {
  res.json({
    message: 'I\'m so hapi!'
  });
});

const port = process.env.PORT || 3000;
app.listen(port, () =>{
  console.log(`Listening on ${port}`);
});
```

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