Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed Jul 16, 2024
1 parent 6b6f1e6 commit 57d5244
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions example/server/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// <reference path="../../types/layout.d.ts" />

import { Readable } from 'node:stream';
import express from 'express';
import Layout from '../../lib/layout.js';
import template from './views/template.js';
Expand Down Expand Up @@ -37,7 +37,7 @@ const app = express();

app.use(layout.pathname(), layout.middleware());

app.get(`${layout.pathname()}/:bar?`, async (req, res) => {
app.get(layout.pathname(), async (req, res) => {
const incoming = res.locals.podium;
const podlets = await Promise.all([
header.fetch(incoming),
Expand All @@ -56,6 +56,20 @@ app.get(`${layout.pathname()}/:bar?`, async (req, res) => {
res.status(200).podiumSend(markup);
});

app.get(`${layout.pathname()}/stream`, async (req, res) => {
const incoming = res.locals.podium;
incoming.view = {
title: 'Example application',
};
const document = Readable.from([template()]);
document.pipe(res);

const headerStream = header.stream(incoming);

Check failure on line 67 in example/server/server.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

'headerStream' is assigned a value but never used

Check failure on line 67 in example/server/server.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

'headerStream' is assigned a value but never used
const menuStream = menu.stream(incoming);

Check failure on line 68 in example/server/server.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

'menuStream' is assigned a value but never used

Check failure on line 68 in example/server/server.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

'menuStream' is assigned a value but never used
const contentStream = content.stream(incoming);

Check failure on line 69 in example/server/server.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

'contentStream' is assigned a value but never used

Check failure on line 69 in example/server/server.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

'contentStream' is assigned a value but never used
const footerStream = footer.stream(incoming);

Check failure on line 70 in example/server/server.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18)

'footerStream' is assigned a value but never used

Check failure on line 70 in example/server/server.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20)

'footerStream' is assigned a value but never used
});

app.use(`${layout.pathname()}/assets`, express.static('assets'));

// eslint-disable-next-line no-unused-vars
Expand Down

0 comments on commit 57d5244

Please sign in to comment.