bin file
This commit is contained in:
parent
114a9ef8bb
commit
7dd82841ef
@ -1,18 +1,19 @@
|
||||
import express from "express";
|
||||
import config from "@/config.json";
|
||||
import { join } from "path";
|
||||
|
||||
const cacheRouter = express.Router();
|
||||
|
||||
cacheRouter.get("/B.Cache.Dx11.bin.*", (_req, res) => {
|
||||
res.sendFile("static/data/B.Cache.Dx11_33.0.6.bin", { root: "./" });
|
||||
res.sendFile(join(__dirname, "../../static/data/B.Cache.Dx11_33.0.6.bin"));
|
||||
});
|
||||
|
||||
cacheRouter.get("/B.Cache.Windows_en.bin*", (_req, res) => {
|
||||
res.sendFile("static/data/B.Cache.Windows_en_33.0.10.bin", { root: "./" });
|
||||
res.sendFile(join(__dirname, "../../static/data/B.Cache.Windows_en_33.0.10.bin"));
|
||||
});
|
||||
|
||||
cacheRouter.get(/^\/origin\/[a-zA-Z0-9]+\/[0-9]+\/H\.Cache\.bin.*$/, (_req, res) => {
|
||||
res.sendFile(`static/data/H.Cache_${config.version}.bin`, { root: "./" });
|
||||
res.sendFile(join(__dirname, `../../static/data/H.Cache_${config.version}.bin`));
|
||||
});
|
||||
|
||||
export { cacheRouter };
|
||||
|
@ -4,6 +4,7 @@ const webpack = require("webpack");
|
||||
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
|
||||
const CopyPlugin = require("copy-webpack-plugin");
|
||||
const Dotenv = require("dotenv-webpack");
|
||||
const config = require("./config.json");
|
||||
|
||||
module.exports = {
|
||||
target: "node",
|
||||
@ -18,7 +19,7 @@ module.exports = {
|
||||
ejs: "ejs"
|
||||
}),
|
||||
new CopyPlugin({
|
||||
patterns: [{ from: "static/certs/", to: "certs/" }]
|
||||
patterns: [{ from: "static/certs/", to: "certs/" }, `static/data/H.Cache_${config.version}.bin`]
|
||||
})
|
||||
],
|
||||
module: {
|
||||
@ -28,6 +29,15 @@ module.exports = {
|
||||
use: "ts-loader",
|
||||
exclude: /node_modules/
|
||||
},
|
||||
{
|
||||
test: /cache\.ts$/,
|
||||
loader: "string-replace-loader",
|
||||
options: {
|
||||
search: "../../static/data/",
|
||||
replace: "./",
|
||||
flags: "g"
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /index\.ts$/,
|
||||
loader: "string-replace-loader",
|
||||
|
Loading…
x
Reference in New Issue
Block a user