authorization:有些驗證的資料會放於此 headers:描述性的資料 body:主要傳送的資料4.前端暫存資料方式(建議無重要性才使用)
1.localStorage 2.cookie參考來源
六角學院直播課
vite.config.js
import { defineConfig } from 'vite';
import fs from 'fs';
export default defineConfig({
server: {
https: {
key: fs.readFileSync('./localhost-key.pem'),
cert: fs.readFileSync('./localhost.pem')
},
port: 3000,
open: true
}
});
package.json
{
"name": "yourname",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
},
"devDependencies": {
"vite": "^7.1.12"
}
}
.gitignore node_modules/ dist/ .vite/ npm-debug.log* .yarn-debug.log* .yarn-error.log* .pnpm-debug.log* .vscode/ .DS_Store Thumbs.db # mkcert local certificates localhost.pem localhost-key.pem3.改package.json裡的name變成你的專案名稱