支持模型库HTTPS开发服务
This commit is contained in:
@@ -1,9 +1,20 @@
|
|||||||
import { defineConfig } from "vite";
|
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({
|
export default defineConfig({
|
||||||
server: {
|
server: {
|
||||||
port: 5174,
|
port: 5174,
|
||||||
strictPort: true,
|
strictPort: true,
|
||||||
|
https: httpsConfig,
|
||||||
proxy: {
|
proxy: {
|
||||||
"/api": "http://127.0.0.1:3001",
|
"/api": "http://127.0.0.1:3001",
|
||||||
"/storage": "http://127.0.0.1:3001"
|
"/storage": "http://127.0.0.1:3001"
|
||||||
|
|||||||
Reference in New Issue
Block a user