# express-amp

> Express middleware to convert website to Google AMP

Latest version **1.0.9** (published 2019-09-04) · MIT license · 0 weekly downloads

## Install

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

## 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.9 |
| Published | 2019-09-04 |
| First published | 2017-07-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10 |
| Dependencies | 1 |
| Unpacked size | 18.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Jordi López |
| Maintainers | jlopezxs |
| Keywords | amp, express, google amp |

## Links

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

## Dependencies (1)

- [ampify](https://npm.io/package/ampify.md) ^0.5.0

## Recent versions

- 1.0.9 (latest) — 2019-09-04
- 1.0.8 — 2018-11-21
- 1.0.5 — 2017-09-21
- 1.0.3 — 2017-07-26
- 1.0.2 — 2017-07-26
- 1.0.0 — 2017-07-24

## README

# express-amp
> :zap: Express middleware to convert website to Google AMP

## Installation

```sh
npm install --save express-amp
```

## Preview
```js
/**
 * Overriding the render method
 * You can use that to avoid use renderAMP
 * With that you can transform all /path in AMP pages
 */

import express from 'express';
import expressAMP from 'express-amp';

const app = express();

app.use(expressAMP({
  override: true,
  staticsPath: `${process.cwd()}/public`
}));

app.get('/', (req, res) => {
  res.render('index', {});
});

```

```js
// Using renderAMP method

import express from 'express';
import expressAMP from 'express-amp';

const app = express();

app.use(expressAMP({
  override: false,
  staticsPath: `${process.cwd()}/public`
}));

app.get('/', (req, res) => {
  res.renderAMP('index', {});
});

```

## Usage

expressAMP({ [override], [staticsPath] });
<!-- {.font-large} -->
where:

- `override` (optional): It brings you the possibility to override the method render or use renderAMP method.
- `staticsPath` (optional): Directory path of the statics files to get it and include inline in AMP page.


## License

MIT © [Jordi López](http://jlopezxs.github.io)

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