diff --git a/public/styles.css b/public/styles.css deleted file mode 100644 index 1aa2d9a..0000000 --- a/public/styles.css +++ /dev/null @@ -1,31 +0,0 @@ -body { - line-height: 1.5; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, - Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; - text-align: center; - padding: 0 1em; - margin: 2em 0; -} - -a { - color: black; - text-decoration: none; -} - -code { - font-family: Menlo, Monaco, "Courier New", monospace; -} - -h1 { - font-size: 1.5em; -} - -footer { - font-size: 0.875em; -} - -input { - border: 1px solid #dfdfdf; - border-radius: 3px; - padding: 0.25em; -} diff --git a/src/index.ts b/src/index.ts index 1547328..daf2229 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,8 @@ import mailparser from "mailparser"; import escapeStringRegexp from "escape-string-regexp"; import fs from "fs-extra"; import cryptoRandomString from "crypto-random-string"; +import { html, HTML } from "@leafac/html"; +import { css, process as processCSS } from "@leafac/css"; const VERSION = require("../package.json").version; @@ -16,7 +18,189 @@ export default function killTheNewsletter( webApplication.set("url", "http://localhost:4000"); webApplication.set("email port", 2525); webApplication.set("email host", "localhost"); - webApplication.set("administrator", "kill-the-newsletter@leafac.com"); + webApplication.set("administrator", "mailto:kill-the-newsletter@leafac.com"); + + webApplication.use(express.static(path.join(__dirname, "../public"))); + webApplication.use(express.urlencoded({ extended: true })); + + const logo = fs.readFileSync(path.join(__dirname, "../public/logo.svg")); + + function layout(body: HTML): HTML { + return processCSS(html` + + +
+ + +Convert email newsletters into Atom feeds
++ $${logo} +
+Convert email newsletters into Atom feeds
-- -
-