Skip to content

Commit

Permalink
Fixed issue where site was not displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpocock committed Dec 4, 2024
1 parent b8d4db4 commit 2bf5116
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/evalite-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"build": "remix vite:build",
"after-build": "rm -rf ../../packages/evalite/dist/ui && cp -r build/client ../../packages/evalite/dist/ui",
"after-build": "rm -rf ../../packages/evalite-core/dist/ui && cp -r build/client ../../packages/evalite-core/dist/ui",
"dev": "remix vite:dev",
"start": "remix-serve ./build/server/index.js",
"lint": "tsc"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"ci": "turbo build test lint",
"build": "turbo build after-build",
"release": "pnpm run ci && changeset publish",
"test-example": "cd packages/example && evalite",
"test-example": "cd packages/example && evalite watch",
"prepare": "husky"
},
"keywords": [],
Expand Down
10 changes: 5 additions & 5 deletions packages/evalite-core/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export const createServer = (opts: { jsonDbLocation: string }) => {
root: path.join(UI_ROOT),
});

const listeners = new Map<string, (event: Evalite.WebsocketEvent) => void>();

server.setNotFoundHandler(async (req, res) => {
res.sendFile(path.join(UI_ROOT, "index.html"));
server.setNotFoundHandler(async (req, reply) => {
return reply.status(200).sendFile("index.html");
});

const listeners = new Map<string, (event: Evalite.WebsocketEvent) => void>();

server.get("/api/evals", async (req, reply) => {
return reply
.code(200)
Expand Down Expand Up @@ -122,7 +122,7 @@ export const createServer = (opts: { jsonDbLocation: string }) => {
},
(err) => {
if (err) {
server.log.error(err);
console.error(err);
process.exit(1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/content-generation.eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ evalite("Content generation", {
input: "Write a TypeScript tweet",
},
{
input: "Write a tweet about TypeScript template literals types.",
input: "Write a tweet about TypeScript template literal types.",
},
];
},
Expand Down

0 comments on commit 2bf5116

Please sign in to comment.