支持模型库HTTPS开发服务

This commit is contained in:
zhangshun
2026-05-29 11:42:36 +08:00
parent 6e4ce87844
commit 697802a2af

View File

@@ -1,9 +1,20 @@
import { defineConfig } from "vite";
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const rootDir = path.resolve(__dirname, "../..");
const httpsConfig = {
key: fs.readFileSync(path.join(rootDir, "certs/localhost+2-key.pem")),
cert: fs.readFileSync(path.join(rootDir, "certs/localhost+2.pem"))
};
export default defineConfig({
server: {
port: 5174,
strictPort: true,
https: httpsConfig,
proxy: {
"/api": "http://127.0.0.1:3001",
"/storage": "http://127.0.0.1:3001"