Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
barankyle committed May 19, 2023
1 parent 522221b commit 9e95de6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@
"credential-handler-polyfill": "^3.2.0",
"cross-env": "7.0.3",
"daisyui": "^2.51.5",
"koa-static": "^5.0.0",
"i18next": "21.6.16",
"i18next-browser-languagedetector": "6.1.3",
"koa-send": "^5.0.1",
"koa-static": "^5.0.0",
"lodash": "4.17.21",
"moment": "2.29.4",
"notistack": "^3.0.1",
Expand Down
7 changes: 4 additions & 3 deletions packages/client/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@ const { join } = require('path');
const { readFileSync } = require('fs');
const Koa = require('@feathersjs/koa');
const serve = require('koa-static');
const sendFile = require('koa-send')
const { path: packageRoot } = require('app-root-path');
const { createServer } = require('https');
const { createServer: _createServer } = require('http');


const app = new Koa();
const app = new Koa.koa();
const PORT = process.env.HOST_PORT || 3000;
const HTTPS = process.env.VITE_LOCAL_BUILD ?? false;

app.use(serve(join(packageRoot, 'packages', 'client', 'dist'), {
brotli: true,
setHeaders: (ctx) => {
ctx.set('Origin-Agent-Cluster', '?1')
ctx.setHeader('Origin-Agent-Cluster', '?1')
}
}));

app.use(async (ctx) => {
await ctx.sendFile(join(packageRoot, 'packages', 'client', 'dist', 'index.html'));
await sendFile(ctx, join('dist', 'index.html'));
});

app.listen = function () {
Expand Down

0 comments on commit 9e95de6

Please sign in to comment.