mirror of
https://github.com/cupcakearmy/blaze.git
synced 2024-12-22 16:26: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>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<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">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<title>Blaze - ${query}</title>
|
<title>Blaze - ${query}</title>
|
||||||
<style>
|
<style>
|
||||||
@ -295,6 +297,14 @@ app.get("/favicon.svg", (_, res) => {
|
|||||||
res.sendFile(path.join(__dirname + "/favicon.svg"));
|
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, () => {
|
app.listen(port, () => {
|
||||||
console.log(`Got request`);
|
console.log(`Got request`);
|
||||||
});
|
});
|
||||||
|
@ -27,7 +27,7 @@ self.addEventListener("fetch", (event: any) => {
|
|||||||
const cachedEtag = cachedResponse
|
const cachedEtag = cachedResponse
|
||||||
? cachedResponse.headers.get("X-Blaze-Etag")
|
? cachedResponse.headers.get("X-Blaze-Etag")
|
||||||
: null;
|
: null;
|
||||||
if (currentEtag === cachedEtag) {
|
if (cachedResponse && currentEtag === cachedEtag) {
|
||||||
return cachedResponse;
|
return cachedResponse;
|
||||||
} else {
|
} else {
|
||||||
return cache
|
return cache
|
||||||
|
Loading…
Reference in New Issue
Block a user