# pomelo-https-plugin

> http(https) plugin for pomelo.

Latest version **0.0.6** (published 2020-10-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install pomelo-https-plugin
pnpm add pomelo-https-plugin
yarn add pomelo-https-plugin
bun add pomelo-https-plugin
```

## 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.6 |
| Published | 2020-10-16 |
| First published | 2020-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 15.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | yunmin |
| Maintainers | yunmin |
| Keywords | pomelo, http, plugin |

## Links

- npm: https://www.npmjs.com/package/pomelo-https-plugin
- Repository: https://github.com/yunmin97/pomelo-https-plugin
- Issues: https://github.com/yunmin97/pomelo-https-plugin/issues
- npm.io page: https://npm.io/package/pomelo-https-plugin

## Dependencies (5)

- [morgan](https://npm.io/package/morgan.md) ^1.8.1
- [express](https://npm.io/package/express.md) ^4.14.1
- [body-parser](https://npm.io/package/body-parser.md) ^1.16.1
- [errorhandler](https://npm.io/package/errorhandler.md) ^1.5.0
- [method-override](https://npm.io/package/method-override.md) ^2.3.7

## Recent versions

- 0.0.6 (latest) — 2020-10-16
- 0.0.5 — 2020-10-16
- 0.0.4 — 2020-10-16
- 0.0.3 — 2020-10-16
- 0.0.2 — 2020-10-16
- 0.0.1 — 2020-10-16

## README

## installation：        
``
npm install pomelo-https-plugin
``      
## instructions(check out the example for more features):
#### 1. modify servers.json, add http server config:        
```js
{
  "development": {
    ...
    "http": [
      {
        "id": "http-server-0",
        "host": "127.0.0.1",
        "port": 5000,
        "httpHost": "127.0.0.1",
        "httpPort": 80
      }
    ]
  },
  "production": {...}
}
```
#### 2. modify adminServer.json, add server type config:        
```js
[
  ...
  {
    "type": "http",
    "token": "agarxhqb98rpajloaxn34ga8xrunpagkjwlaw3ruxnpaagl29w4rxn"
  }
]
```
#### 3. modify app.js       
```js
...
const httpPlugin = require('pomelo-http-plugin');
...
app.configure('development', 'http', function () {
    app.use(httpPlugin, {
        http: {
            useSSL: false
        }
    });
});
```
#### 4. create app/servers/http/route/httpRoute.js
```js
module.exports = function(app, http) {
    http.get('/test', function (req, res, next) {
        res.send('http success');
        next();
    });
};
```     
## server cluster(just like pomelo`s way), only step 1 makes a difference           
```js
{
  "development": {
    ...
    "http": [
      {
        "clusterCount": 2,
        "id": "http-server-0",
        "host": "127.0.0.1",
        "port": "5000++",
        "httpHost": "127.0.0.1",
        "httpPort": "80++"
      }
    ]
  },
  "production": {...}
}
```
## enjoy it

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