diff options
author | Mark Powers <markppowers0@gmail.com> | 2020-08-13 10:44:19 -0500 |
---|---|---|
committer | Mark Powers <markppowers0@gmail.com> | 2020-08-13 10:44:19 -0500 |
commit | 09fdcb05b2c1fa7a51e4b4110c7317b5d0e361f4 (patch) | |
tree | c8cda2ebf13c2ef091f509b8d18136db62e9b360 /src | |
parent | c1d460f2b88a102be05ddeb04af57db90c9f92bf (diff) |
Remove client JS requirement from /bread
Diffstat (limited to 'src')
-rw-r--r-- | src/server.js | 11 | ||||
-rw-r--r-- | src/templates.js | 21 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/server.js b/src/server.js index a419c74..8114172 100644 --- a/src/server.js +++ b/src/server.js @@ -134,6 +134,17 @@ function setUpRoutes(models, jwtFunctions, database) { res.status(200).send(html.join("")) // res.sendFile(__dirname + "/html/index.html") }) + server.get('/bread', async (req, res) => { + var html = [] + html.push(templates["bread"]["pre"]) + // html.push(templates["titlebar"]) + html.push(await constructFeed(models, "bread")) + html.push(templates["footer"]) + html.push(templates["bread"]["post"]) + + res.status(200).send(html.join("")) + // res.sendFile(__dirname + "/html/index.html") + }) server.get('/admin', (req, res) => res.sendFile(__dirname + "/html/admin.html")); server.get('/login', (req, res) => res.sendFile(__dirname + "/html/login.html")) server.get('/email', (req, res) => res.sendFile(__dirname + "/html/email.html")) diff --git a/src/templates.js b/src/templates.js index b1cde30..07a774c 100644 --- a/src/templates.js +++ b/src/templates.js @@ -36,5 +36,26 @@ module.exports = { <h1>Welcome to Mark's Kitchen</h1>`, post: `</body> </html>` + }, + bread: { + pre: `<!doctype html> + <html lang="en"> + + <head> + <title>Mark's Kitchen - Bread</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <link rel="stylesheet" type="text/css" href="/css/styles.css"> + <link rel="shortcut icon" href="/favicon.ico"> + </head> + + <body> + <h1> + <a class="navigation" href="/" title="marks.kitchen"><</a> + Bread + </h1> + Some highlights (and lowlights) of breadmaking`, + post: `</body> + </html>` } }
\ No newline at end of file |