Skip to content

Commit

Permalink
Merge pull request #123 from su-its/fix/frontend/text-notfound
Browse files Browse the repository at this point in the history
fix: move texts to public dir in order to fix not found error
  • Loading branch information
h-takeyeah authored Apr 16, 2024
2 parents bc3640f + 45376bb commit 09d05a2
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions typing-app/src/app/game/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import GamePage from "@/components/pages/Game";
import fs from "fs";

const filenames = fs.readdirSync("public/texts/");

export default function Typing() {
const filenames = fs.readdirSync("src/assets/texts/");
const subjectText = fs.readFileSync(
`src/assets/texts/${filenames[Math.floor(Math.random() * filenames.length)]}`,
`public/texts/${filenames[Math.floor(Math.random() * filenames.length)]}`,
"utf-8"
);

Expand Down

0 comments on commit 09d05a2

Please sign in to comment.