documentationjs / documentationjs/documentation

HTTPS support for documentation serve

Open
#1,262 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.8k
Forks
481
PR merge metrics
No merged PRs in 30d

Description

* What version of documentation.js are you using?:
```bash
$ grep '"version"' node_modules/documentation/package.json
"version": "11.0.1"
```

* How are you running documentation.js (on the CLI, Node.js API, Grunt, other?):

`npx documentation serve`

* Feature Request

`documentation serve` has no built-in way to serve over HTTPS; you'd have to SSL terminate through `nginx`, use `node-http-proxy`, or something like that.

Providing SSL command-line arguments here (e.g. `--https-key`, `--https-cert`) would simplify usage in HTTPS-only environments.

* Suggested Fix

In [`src/commands/serve.js`](https://github.com/documentationjs/documentation/blob/master/src/commands/serve.js#L24), add command-line args for SSL key / cert, and pass these options to `new Server()`. By default, these would be `undefined`, and they would both be required to start up in HTTPS mode.

In [`src/serve/server.js`](https://github.com/documentationjs/documentation/blob/master/src/serve/server.js#L90), use SSL options to decide whether to `http.createServer()` or `https.createServer()`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.