feat: add support for HTTPS with --pem option in both Python and Node.js servers
This commit is contained in:
@@ -20,16 +20,21 @@ To run the server from the command line:
|
||||
python3 ok-server.py
|
||||
python3 ok-server.py --look basic
|
||||
python3 ok-server.py --bind 127.0.0.1 --port 8080 --look tailwind
|
||||
python3 ok-server.py --pem /path/to/bundle.pem --port 8443
|
||||
```
|
||||
|
||||
`--look` accepts `basic`, `nice`, `bootstrap`, or `tailwind`.
|
||||
You can override the look per request with the `look` query parameter, for example:
|
||||
`http://localhost:8080/?look=tailwind`
|
||||
|
||||
`--pem` accepts a path to a PEM file containing the certificate chain and private key.
|
||||
When provided, the server listens on HTTPS instead of plain HTTP.
|
||||
|
||||
```bash
|
||||
node ok-server.mjs
|
||||
node ok-server.mjs --look basic
|
||||
node ok-server.mjs --bind 127.0.0.1 --port 8080 --look tailwind
|
||||
node ok-server.mjs --pem /path/to/bundle.pem --port 8443
|
||||
```
|
||||
|
||||
Connect to the server using a web browser or a tool like `curl`:
|
||||
|
||||
Reference in New Issue
Block a user