Closed t0mri closed 11 months ago
Have you seen the folder example
?
This plugin does not serve static folder, you need and additional plugin for that. You need to serve html content from any endpoint and provide a folder to watch for changes as you do.
You also need to provide .listen
method to run elysia.
Close due no answer or any actions from author. If you still have similar issues please reopen it.
now what?
new Elysia()
.use(hmr({ prefixToWatch: "src" }))
.use(staticPlugin({ assets: "src", prefix: "/public" }))
.get(`/`, () => `hello`)
.listen(3000, ({ hostname, port }) => {
console.log(`🦊 running on http://${hostname}:${port}`);
});
my file structure
project
|- node_modules
|- src
|- index.ts
You need an src/public
directory, it will fail if it does not exists. You must have also html files inside.
It will look for changes in any file but it will refresh only html content type so if you response with a content type text/plain
as you do you won't see any updates.
If you change content in any javascript or typescript file you should use --watch with bun because the content won't change unless the module file is reloaded.
well the thing im tryna do is out this projects scope ig