You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| - public
| - index.html
| - test
| - index.html
| - test.ts
Files
index.html -> fill in with any generic HTML content.
// test.tsimport{Elysia}from'elysia';import{staticPlugin}from'@elysiajs/static';constport=8080;consthostname='0.0.0.0';constapp=newElysia().use(staticPlugin({prefix: '/',indexHTML: true})).listen({ port, hostname });console.log(`Server started at ${app.server?.url}`);
Note
indexHTML is true by default, but I set it to true explicitly anyways
Versions
Bun -> 1.1.31
elysia -> 1.1.20
@elysiajs/static -> 1.1.1
Tests
GET http://localhost:8080/ -> (redirect)http://localhost:8080 -> NOT_FOUND
GET http://localhost:8080 -> NOT_FOUND
GET http://localhost:8080/test -> NOT_FOUND
GET http://localhost:8080/test/ -> NOT_FOUND
GET http://localhost:8080/index.html -> Works
GET http://localhost:8080/test/index.html -> Works
Conclusion
indexHTML option in all broken in all shape and form is the latest version. After some testing, the last working version is 1.0.3.
The text was updated successfully, but these errors were encountered:
touhidurrr
changed the title
[IMPORTANT] [BUG] indexHTML option is broken static plugin latest version
[IMPORTANT] [BUG] indexHTML option is broken in latest version
Oct 10, 2024
Important
This bug only appears when
NODE_ENV=production
Folder structure
Files
index.html -> fill in with any generic HTML content.
Note
indexHTML
istrue
by default, but I set it to true explicitly anywaysVersions
Bun
-> 1.1.31elysia
-> 1.1.20@elysiajs/static
-> 1.1.1Tests
GET http://localhost:8080/
-> (redirect)http://localhost:8080
->NOT_FOUND
GET http://localhost:8080
->NOT_FOUND
GET http://localhost:8080/test
->NOT_FOUND
GET http://localhost:8080/test/
->NOT_FOUND
GET http://localhost:8080/index.html
-> WorksGET http://localhost:8080/test/index.html
-> WorksConclusion
indexHTML
option in all broken in all shape and form is the latest version. After some testing, the last working version is 1.0.3.The text was updated successfully, but these errors were encountered: