fix
This commit is contained in:
parent
d6644860ee
commit
c33e081841
|
|
@ -1,6 +1,6 @@
|
||||||
import { $ } from "bun";
|
import { $ } from "bun";
|
||||||
import Database from "bun:sqlite";
|
import Database from "bun:sqlite";
|
||||||
import { copyAsync, removeAsync } from "fs-jetpack";
|
import { copyAsync } from "fs-jetpack";
|
||||||
import mime from "mime";
|
import mime from "mime";
|
||||||
import { deploy } from "utils/deploy";
|
import { deploy } from "utils/deploy";
|
||||||
import { dir } from "utils/dir";
|
import { dir } from "utils/dir";
|
||||||
|
|
@ -50,6 +50,7 @@ export const _ = {
|
||||||
content: g.deploy.content?.site?.config?.api_url || "",
|
content: g.deploy.content?.site?.config?.api_url || "",
|
||||||
});
|
});
|
||||||
const gz = g.deploy.content;
|
const gz = g.deploy.content;
|
||||||
|
|
||||||
if (gz) {
|
if (gz) {
|
||||||
let layout = null as null | SinglePage;
|
let layout = null as null | SinglePage;
|
||||||
for (const l of gz.layouts) {
|
for (const l of gz.layouts) {
|
||||||
|
|
@ -80,7 +81,7 @@ export const _ = {
|
||||||
add({
|
add({
|
||||||
path: "load-js",
|
path: "load-js",
|
||||||
type: "",
|
type: "",
|
||||||
content: await getContent("load.js.prod", api_url),
|
content: await getContent("load.js.prod", `"${api_url}"`),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ export const createResponse = (
|
||||||
|
|
||||||
if (opt?.cache_accept) {
|
if (opt?.cache_accept) {
|
||||||
let cached = false;
|
let cached = false;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
opt?.high_compression &&
|
opt?.high_compression &&
|
||||||
opt.cache_accept.toLowerCase().includes("br")
|
opt.cache_accept.toLowerCase().includes("br")
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export const serveWeb = async (arg: {
|
||||||
|
|
||||||
return createResponse(arg.content, {
|
return createResponse(arg.content, {
|
||||||
cache_accept: arg.cache_accept,
|
cache_accept: arg.cache_accept,
|
||||||
high_compression: false,
|
high_compression: true,
|
||||||
headers: !type ? undefined : { "content-type": type },
|
headers: !type ? undefined : { "content-type": type },
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ export const deploy = {
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
`Downloading site deploy: ${this.config.site_id} [ts: ${this.config.deploy.ts}]`
|
`Downloading site deploy: ${this.config.site_id} [ts: ${this.config.deploy.ts}] ${base_url}`
|
||||||
);
|
);
|
||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
`${base_url}/prod-zip/${this.config.site_id}?ts=${Date.now()}&msgpack=1`
|
`${base_url}/prod-zip/${this.config.site_id}?ts=${Date.now()}&msgpack=1`
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue