支持模型库HTTPS开发服务
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user