Closed myukselen closed 1 month ago
Hi Severin,
Thanks for your nice cli! I repurposed to my need and it is working great! I'd love to share it back with you with this PR.
My usecase is to create a bun single file executable with elysia framework.
I utilize it in a quick and dirty way similar to this:
import staticFilesApp from "./static-files-app" const app = new Elysia() .onError((ctx) => { if (ctx.code === 'NOT_FOUND') { if (ctx.path.startsWith('/app/')) { // ctx.set.redirect = '/app/'; // looses path for the SPA ctx.set.status = 'OK' const path = ctx.path.slice(5); // leading /app/ removed if (path in staticFilesApp) { return staticFilesApp[path]; } return staticFilesApp['index.html']; } else { ctx.set.redirect = '/'; } return ''; } }) ...
Thanks, -Murat
@myukselen we could add a section in the readme for how to use w/ Elysia, going to create an issue from this comment
Hi Severin,
Thanks for your nice cli! I repurposed to my need and it is working great! I'd love to share it back with you with this PR.
My usecase is to create a bun single file executable with elysia framework.
I utilize it in a quick and dirty way similar to this:
Thanks, -Murat