From 09fdcb05b2c1fa7a51e4b4110c7317b5d0e361f4 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Thu, 13 Aug 2020 10:44:19 -0500 Subject: Remove client JS requirement from /bread --- src/server.js | 11 +++++++++++ src/templates.js | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'src') 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 = {

Welcome to Mark's Kitchen

`, post: ` ` + }, + bread: { + pre: ` + + + + Mark's Kitchen - Bread + + + + + + + +

+ < + Bread +

+ Some highlights (and lowlights) of breadmaking`, + post: ` + ` } } \ No newline at end of file -- cgit v1.2.3