abcdef38
abcdef38
DDeno
Created by abcdef38 on 9/16/2023 in #help
In Deno, what is the best way to simply host static websites?
Well, I only know of it because I accidentally used it and all my code changes did nothing. It took me a while to realise this.
19 replies
DDeno
Created by abcdef38 on 9/16/2023 in #help
In Deno, what is the best way to simply host static websites?
But status 304 works.
19 replies
DDeno
Created by abcdef38 on 9/16/2023 in #help
In Deno, what is the best way to simply host static websites?
Oh, okay.
19 replies
DDeno
Created by abcdef38 on 9/16/2023 in #help
In Deno, what is the best way to simply host static websites?
That's just status code 304.
19 replies
DDeno
Created by abcdef38 on 9/16/2023 in #help
In Deno, what is the best way to simply host static websites?
That is not really the same thing, but okay.
19 replies
DDeno
Created by Munda on 9/17/2023 in #help
Error at the execution of a programm
+ why are you making a function to get the values?
14 replies
DDeno
Created by Munda on 9/17/2023 in #help
Error at the execution of a programm
+ share the code.
14 replies
DDeno
Created by Munda on 9/17/2023 in #help
Error at the execution of a programm
That's probably your problem.
14 replies
DDeno
Created by abcdef38 on 9/16/2023 in #help
In Deno, what is the best way to simply host static websites?
How?
import { serveDir, serveFile } from "https://deno.land/std@0.194.0/http/file_server.ts";
Deno.serve((req: Request) => {
const pathname = new URL(req.url).pathname;

if (pathname === "/simple_file") {
return serveFile(req, "./path/to/file.txt");
}

if (pathname.startsWith("/static")) {
return serveDir(req, {
fsRoot: "public",
urlRoot: "static",
});
}

return new Response("404: Not Found", {
status: 404,
});
});
import { serveDir, serveFile } from "https://deno.land/std@0.194.0/http/file_server.ts";
Deno.serve((req: Request) => {
const pathname = new URL(req.url).pathname;

if (pathname === "/simple_file") {
return serveFile(req, "./path/to/file.txt");
}

if (pathname.startsWith("/static")) {
return serveDir(req, {
fsRoot: "public",
urlRoot: "static",
});
}

return new Response("404: Not Found", {
status: 404,
});
});
19 replies
DDeno
Created by abcdef38 on 9/16/2023 in #help
In Deno, what is the best way to simply host static websites?
19 replies
DDeno
Created by abcdef38 on 9/16/2023 in #help
In Deno, what is the best way to simply host static websites?
Bun.serve can do 2x-3x the amount of requests/second, which can't be right.
19 replies
DDeno
Created by abcdef38 on 9/16/2023 in #help
In Deno, what is the best way to simply host static websites?
But what about getting the highest number of requests/second locally?
19 replies
DDeno
Created by abcdef38 on 9/16/2023 in #help
In Deno, what is the best way to simply host static websites?
I'm better off implementing a system myself maybe.
19 replies
DDeno
Created by abcdef38 on 9/16/2023 in #help
In Deno, what is the best way to simply host static websites?
It doesn't do caching or anything like that.
19 replies
DDeno
Created by abcdef38 on 9/16/2023 in #help
In Deno, what is the best way to simply host static websites?
Thanks, but that is not really what I'm looking for.
19 replies
DDeno
Created by abcdef38 on 9/16/2023 in #help
In Deno, what is the best way to simply host static websites?
Also how much can I optimise
Deno.serve((_req) => {
return new Response("Hello, World!");
})
Deno.serve((_req) => {
return new Response("Hello, World!");
})
, I want the highest possible requests/second.
19 replies