From fff5192fb42a0f4fbfe0662a2c4c6caa14462c88 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 1 Nov 2019 04:19:32 -0600 Subject: [PATCH] on second thought, just the node app example --- README.md | 43 +++++++++++-------------------------------- 1 file changed, 11 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 3df9ace..99d50a3 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,18 @@ Free SSL, Automated HTTPS / HTTP2, served with Node via Express, Koa, hapi, etc. Greenlock Express is a **Web Server** with **Fully Automated HTTPS** and renewals. ```js -var pkg = require("./package.json"); +"use strict"; +function httpsWorker(glx) { + // Serves on 80 and 443 + // Get's SSL certificates magically! + + glx.serveApp(function(req, res) { + res.end("Hello, Encrypted World!"); + }); +} + +var pkg = require("./package.json"); require("greenlock-express") .init(function getConfig() { // Greenlock Config @@ -34,37 +44,6 @@ require("greenlock-express") .serve(httpsWorker); ``` -With **Express**: - -```js -function httpsWorker(glx) { - // Works with any Node app (Express, etc) - var app = require("./my-express-app.js"); - - // See, all normal stuff here - app.get("/hello", function(req, res) { - res.end("Hello, Encrypted World!"); - }); - - // Serves on 80 and 443 - // Get's SSL certificates magically! - glx.serveApp(app); -} -``` - -Or with **plain** node HTTP: - -```js -function httpsWorker(glx) { - // Serves on 80 and 443 - // Get's SSL certificates magically! - - glx.serveApp(function(req, res) { - res.end("Hello, Encrypted World!"); - }); -} -``` - Manage via API or the config file: `~/.config/greenlock/manage.json`: (default filesystem config)