mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-30 00:41:24 +00:00
Disable test instance to remove index.
This commit is contained in:
parent
f3a825c0e7
commit
9d97350f09
1 changed files with 11 additions and 3 deletions
14
web/index.js
14
web/index.js
|
@ -14,6 +14,12 @@ const DIST_ROOT = path.resolve(__dirname, 'dist');
|
|||
app.proxy = true;
|
||||
|
||||
app.use(async (ctx, next) => {
|
||||
if (ctx.request.url !== '/robots.txt') {
|
||||
ctx.status = 404;
|
||||
ctx.body = 'Test instance disabled. Visit https://odysee.com for the actual site.';
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await next();
|
||||
} catch (err) {
|
||||
|
@ -29,9 +35,11 @@ app.use(redirectMiddleware);
|
|||
app.use(iframeDestroyerMiddleware);
|
||||
|
||||
// Check if the request url matches any assets inside of /dist
|
||||
app.use(serve(DIST_ROOT, {
|
||||
maxage: 3600000, // set a cache time of one hour, helpful for mobile dev
|
||||
}));
|
||||
app.use(
|
||||
serve(DIST_ROOT, {
|
||||
maxage: 3600000, // set a cache time of one hour, helpful for mobile dev
|
||||
})
|
||||
);
|
||||
|
||||
app.use(serve(DIST_ROOT)); // Check if the request url matches any assets inside of /dist
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue