openvibers/openvibe.run Commits
Run: the front page loads the showcase stylesheet from /shared (it 404ed) (#33)
Changes
@@@ -12,6 +12,7 @@const shell = require('openvibe-shared/shell');const showcase = require('openvibe-shared/showcase');const appIcon = require('openvibe-shared/app-icon');++const ovServe = require('openvibe-shared/serve');const SITE_NAME = 'OpenVibe.Run';const NETWORK_URL = 'https://openvibe.network';@@@ -55,7 +56,7 @@ function renderHome({ config }) {canonical: `${config.baseUrl}/`, robots: 'index, follow',navbar: nav, footer: { service: 'run', variant: 'full', mount: '#ov-footer', brandName: SITE_NAME }, home: '/',navLinks: nav.links,-- head: [appIcon.headTags({ site: 'run' }), '<link rel="manifest" href="/manifest.webmanifest">', `<link rel="stylesheet" href="${showcase.STYLESHEET}">`].join('\n'),++ head: [appIcon.headTags({ site: 'run' }), '<link rel="manifest" href="/manifest.webmanifest">', `<link rel="stylesheet" href="${ovServe.url(showcase.STYLESHEET)}">`].join('\n'),body: `<div id="navbar-mount"></div>\n<main id="main">${body()}</main>`,});}@@@ -20,6 +20,12 @@ const { boot, check, done } = require('./helpers/app');assert.ok(r.text.includes('POST /api/v1/jobs/:id/stream/ticket'), 'the stream ticket route as the API names it');assert.ok(r.text.includes('"artifact"') || r.text.includes('"artifact"'), 'the example names an artifact, as the job contract requires');assert.ok(!/coming soon|placeholder/i.test(r.text), 'no placeholder copy');++ // The showcase stylesheet is the pinned copy under /shared, content-addressed, and it answers.++ const css = /<link rel="stylesheet" href="(\/shared\/showcase\.css\?v=[0-9a-f]{12})">/.exec(r.text);++ assert.ok(css, 'showcase.css is linked from /shared');++ const sheet = await t.call('GET', css[1], { token: null });++ assert.strictEqual(sheet.status, 200);++ assert.match(sheet.headers.get('content-type'), /text\/css/);});await check('the legal pages, robots.txt, the sitemap, the icon and the manifest', async () => {for (const p of ['/terms', '/privacy', '/dmca']) assert.strictEqual((await t.call('GET', p, { token: null })).status, 200, p);
@@ -12,6 +12,7 @@
@@ -12,6 +12,7 @@
const shell = require('openvibe-shared/shell');
const shell = require('openvibe-shared/shell');
const showcase = require('openvibe-shared/showcase');
const showcase = require('openvibe-shared/showcase');
const appIcon = require('openvibe-shared/app-icon');
const appIcon = require('openvibe-shared/app-icon');
+const ovServe = require('openvibe-shared/serve');
const SITE_NAME = 'OpenVibe.Run';
const SITE_NAME = 'OpenVibe.Run';
const NETWORK_URL = 'https://openvibe.network';
const NETWORK_URL = 'https://openvibe.network';
@@ -55,7 +56,7 @@ function renderHome({ config }) {
@@ -55,7 +56,7 @@ function renderHome({ config }) {
canonical: `${config.baseUrl}/`, robots: 'index, follow',
canonical: `${config.baseUrl}/`, robots: 'index, follow',
navbar: nav, footer: { service: 'run', variant: 'full', mount: '#ov-footer', brandName: SITE_NAME }, home: '/',
navbar: nav, footer: { service: 'run', variant: 'full', mount: '#ov-footer', brandName: SITE_NAME }, home: '/',
navLinks: nav.links,
navLinks: nav.links,
- head: [appIcon.headTags({ site: 'run' }), '<link rel="manifest" href="/manifest.webmanifest">', `<link rel="stylesheet" href="${showcase.STYLESHEET}">`].join('\n'),
+ head: [appIcon.headTags({ site: 'run' }), '<link rel="manifest" href="/manifest.webmanifest">', `<link rel="stylesheet" href="${ovServe.url(showcase.STYLESHEET)}">`].join('\n'),
body: `<div id="navbar-mount"></div>\n<main id="main">${body()}</main>`,
body: `<div id="navbar-mount"></div>\n<main id="main">${body()}</main>`,
});
});
}
}
@@ -20,6 +20,12 @@ const { boot, check, done } = require('./helpers/app');
@@ -20,6 +20,12 @@ const { boot, check, done } = require('./helpers/app');
assert.ok(r.text.includes('POST /api/v1/jobs/:id/stream/ticket'), 'the stream ticket route as the API names it');
assert.ok(r.text.includes('POST /api/v1/jobs/:id/stream/ticket'), 'the stream ticket route as the API names it');
assert.ok(r.text.includes('"artifact"') || r.text.includes('"artifact"'), 'the example names an artifact, as the job contract requires');
assert.ok(r.text.includes('"artifact"') || r.text.includes('"artifact"'), 'the example names an artifact, as the job contract requires');
assert.ok(!/coming soon|placeholder/i.test(r.text), 'no placeholder copy');
assert.ok(!/coming soon|placeholder/i.test(r.text), 'no placeholder copy');
+ // The showcase stylesheet is the pinned copy under /shared, content-addressed, and it answers.
+ const css = /<link rel="stylesheet" href="(\/shared\/showcase\.css\?v=[0-9a-f]{12})">/.exec(r.text);
+ assert.ok(css, 'showcase.css is linked from /shared');
+ const sheet = await t.call('GET', css[1], { token: null });
+ assert.strictEqual(sheet.status, 200);
+ assert.match(sheet.headers.get('content-type'), /text\/css/);
});
});
await check('the legal pages, robots.txt, the sitemap, the icon and the manifest', async () => {
await check('the legal pages, robots.txt, the sitemap, the icon and the manifest', async () => {
for (const p of ['/terms', '/privacy', '/dmca']) assert.strictEqual((await t.call('GET', p, { token: null })).status, 200, p);
for (const p of ['/terms', '/privacy', '/dmca']) assert.strictEqual((await t.call('GET', p, { token: null })).status, 200, p);