plugins/static #587
Replies: 3 comments 7 replies
-
|
Can I have the static pluging serve content for the site root? |
Beta Was this translation helpful? Give feedback.
-
|
Seems this plugin doesn't work for newly uploaded files, |
Beta Was this translation helpful? Give feedback.
-
🦊 Elysia is running at localhost:3002
164 | if (shouldIgnore(pathName)) throw new NotFoundError();
165 | const cache = fileCache.get(pathName);
166 | if (cache) return cache.clone();
167 | try {
168 | const fileStat = await fs.stat(pathName).catch(() => null);
169 | if (!fileStat) throw new NotFoundError();
^
error: NOT_FOUND
status: 404,
code: "NOT_FOUND"
at <anonymous> (/Users/macbookpro/Documents/project/monorepo/sci-master/node_modules/.pnpm/@elysiajs+static@1.4.7_elysia@1.4.22_@sinclair+typebox@0.34.48_exact-mirror@0.2.6_@sinc_894428d145c519d7fe4e3799772fabe9/node_modules/@elysiajs/static/dist/index.mjs:169:32)
at async handle (file:///Users/macbookpro/Documents/project/monorepo/sci-master/node_modules/.pnpm/elysia@1.4.22_@sinclair+typebox@0.34.48_exact-mirror@0.2.6_@sinclair+typebox@0.34.48__f_22fc0dc8ac9c2b02f26b937f6751f981/node_modules/elysia/dist/bun/index.js:7:37)does anyone have any suggestions? new Elysia().use(staticPlugin({ prefix: "/" }))i can display image but server give that log and the url cannot display with another website, like i need display in my nextjs website and give 400 error code I'm still in development mode, if development mode is like this i am not sure about production mode |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
plugins/static
Plugin for Elysia that adds support for serving static files/folders for Elysia Server. Start by installing the plugin with "bun add @elysiajs/static".
https://elysiajs.com/plugins/static
Beta Was this translation helpful? Give feedback.
All reactions