From 1c6e96e94c4b61d009077889bd944673cc8f6594 Mon Sep 17 00:00:00 2001 From: Keith Solomon Date: Tue, 27 May 2025 18:51:15 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8feature:=20Incorporate=20new=20sites?= =?UTF-8?q?=20routes,=20add=20dummy=20favicon=20to=20stop=20404=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/favicon.ico | 1 + public/stylesheets/style.css | 48 ++++++------------------------------ routes/sites.js | 27 +++++++++++++++++++- views/domain-cards.ejs | 2 +- 4 files changed, 35 insertions(+), 43 deletions(-) create mode 100644 public/favicon.ico diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/public/favicon.ico @@ -0,0 +1 @@ + diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index dd94b0d..1c57e27 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -7,7 +7,6 @@ --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; --color-blue-400: oklch(70.7% 0.165 254.624); - --color-slate-300: oklch(86.9% 0.022 252.894); --color-slate-900: oklch(20.8% 0.042 265.755); --color-gray-200: oklch(92.8% 0.006 264.531); --color-gray-400: oklch(70.7% 0.022 261.325); @@ -22,7 +21,6 @@ --font-weight-normal: 400; --font-weight-bold: 700; --radius-sm: 0.25rem; - --ease-out: cubic-bezier(0, 0, 0.2, 1); --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); --default-transition-duration: 150ms; --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); @@ -34,7 +32,6 @@ --color-success: oklch(64.01% 0.1751 146.7); --color-info: oklch(0.55 0.0922 211.57); --color-warning: oklch(84.42% 0.1722 84.93); - --text-18px: clamp(0.875rem, 0.9375vw, 1.9rem); --text-25px: clamp(1.125rem, 1.3021vw, 2.2rem); --h1: calc(var(--text-base) * 2.25); --h2: calc(var(--text-base) * 1.75); @@ -1469,11 +1466,6 @@ } } } - .drawer-content { - grid-column-start: 2; - grid-row-start: 1; - min-width: calc(0.25rem * 0); - } .container { width: 100%; @media (width >= 40rem) { @@ -2212,9 +2204,6 @@ .min-h-\[70dvh\] { min-height: 70dvh; } - .w-96 { - width: calc(var(--spacing) * 96); - } .w-fit { width: fit-content; } @@ -2265,9 +2254,6 @@ .resize { resize: both; } - .list-none { - list-style-type: none; - } .grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); } @@ -2335,9 +2321,6 @@ .p-4 { padding: calc(var(--spacing) * 4); } - .px-4 { - padding-inline: calc(var(--spacing) * 4); - } .px-8 { padding-inline: calc(var(--spacing) * 8); } @@ -2347,9 +2330,6 @@ .text-center { text-align: center; } - .text-18px { - font-size: var(--text-18px); - } .text-25px { font-size: var(--text-25px); } @@ -2373,8 +2353,11 @@ .text-gray-800 { color: var(--color-gray-800); } - .text-slate-300 { - color: var(--color-slate-300); + .text-info-content { + color: var(--color-info-content); + } + .text-info-content\! { + color: var(--color-info-content) !important; } .text-white { color: var(--color-white); @@ -2406,10 +2389,6 @@ --tw-ease: var(--ease-in-out); transition-timing-function: var(--ease-in-out); } - .ease-out { - --tw-ease: var(--ease-out); - transition-timing-function: var(--ease-out); - } .card-lg { .card-body { --card-p: 2rem; @@ -2419,18 +2398,10 @@ --cardtitle-fs: 1.25rem; } } - .badge-info { - --badge-color: var(--color-info); - --badge-fg: var(--color-info-content); - } .btn-info { --btn-color: var(--color-info); --btn-fg: var(--color-info-content); } - .btn-primary { - --btn-color: var(--color-primary); - --btn-fg: var(--color-primary-content); - } .hover\:text-gray-400 { &:hover { @media (hover: hover) { @@ -2438,10 +2409,10 @@ } } } - .hover\:text-white { + .hover\:text-info-content\! { &:hover { @media (hover: hover) { - color: var(--color-white); + color: var(--color-info-content) !important; } } } @@ -2452,11 +2423,6 @@ } } } - .sm\:grid-cols-2 { - @media (width >= 40rem) { - grid-template-columns: repeat(2, minmax(0, 1fr)); - } - } .md\:grid-cols-3 { @media (width >= 48rem) { grid-template-columns: repeat(3, minmax(0, 1fr)); diff --git a/routes/sites.js b/routes/sites.js index f1a8b4e..b528682 100644 --- a/routes/sites.js +++ b/routes/sites.js @@ -37,6 +37,31 @@ router.get('/:id', async function (req, res, next) { } }); +/** + * GET site by domain name. + * + * Returns a specific site by its domain name in JSON format. + */ +router.get('/domain/:domain', async function (req, res, next) { + const domainName = req.params.domain; + let sites = null; + + try { + sites = await siteModel.getByDomainName(domainName); + } catch (error) { + console.error('Error fetching site by domain name:', error); + return res.status(400).send('Error fetching site: ' + error.message); + } + + console.log('Site found:', sites); + + if (!sites || sites.length === 0) { + return res.status(404).send('Site not found'); + } else { + res.json(sites[0]); // Return the first match + } +}); + /** * POST create a new site. * @@ -59,7 +84,7 @@ router.post('/add', async function (req, res, next) { if (!newSite) { res.status(400).send('Error creating site'); } else { - res.redirect('/'); // status 304 + res.status(201).json(newSite); } }); diff --git a/views/domain-cards.ejs b/views/domain-cards.ejs index c8c34a4..1f6bccf 100644 --- a/views/domain-cards.ejs +++ b/views/domain-cards.ejs @@ -41,7 +41,7 @@ data.forEach(item => { <% }) %>
- View All Tests + View All Tests