mirror of
https://github.com/cupcakearmy/blaze.git
synced 2024-12-22 08:16:26 +00:00
Fix bug err failed
This commit is contained in:
parent
78cd3ed78f
commit
5e65c17c4b
10
index.ts
10
index.ts
@ -100,6 +100,8 @@ app.get("/", async (req, res) => {
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.svg" />
|
||||
<link rel="stylesheet" href="/styles/serp.css" media="print" onload="this.media='all'">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Blaze - ${query}</title>
|
||||
<style>
|
||||
@ -295,6 +297,14 @@ app.get("/favicon.svg", (_, res) => {
|
||||
res.sendFile(path.join(__dirname + "/favicon.svg"));
|
||||
});
|
||||
|
||||
app.get("/service-worker.js", (_, res) => {
|
||||
res.sendFile(path.join(__dirname + "/service-worker.js"));
|
||||
});
|
||||
|
||||
app.get("/styles/serp.css", (_, res) => {
|
||||
res.sendFile(path.join(__dirname + "/styles/serp.css"));
|
||||
});
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Got request`);
|
||||
});
|
||||
|
@ -27,7 +27,7 @@ self.addEventListener("fetch", (event: any) => {
|
||||
const cachedEtag = cachedResponse
|
||||
? cachedResponse.headers.get("X-Blaze-Etag")
|
||||
: null;
|
||||
if (currentEtag === cachedEtag) {
|
||||
if (cachedResponse && currentEtag === cachedEtag) {
|
||||
return cachedResponse;
|
||||
} else {
|
||||
return cache
|
||||
|
Loading…
Reference in New Issue
Block a user