forked from admin/deShanXiao
Compare commits
1 Commits
lxbfyeaa-p
...
@@m45ik
| Author | SHA1 | Date | |
|---|---|---|---|
| ffc6a8c4b6 |
@@ -1,24 +0,0 @@
|
|||||||
require("module-alias/register"); // 别名加载
|
|
||||||
|
|
||||||
import express from "express";
|
|
||||||
import bodyParser from "body-parser";
|
|
||||||
import routerIndex from "./src/router/index";
|
|
||||||
import { createConnection } from "typeorm";
|
|
||||||
import cors from "cors";
|
|
||||||
|
|
||||||
const app = express();
|
|
||||||
const port = 8101;
|
|
||||||
createConnection().then(() => {
|
|
||||||
console.log("数据库连接成功!");
|
|
||||||
app.listen(port, () => {
|
|
||||||
console.log(`开始监听${port}了`);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
app.use(bodyParser.urlencoded({ extended: true })); // 进行url解码
|
|
||||||
app.use(bodyParser.json());
|
|
||||||
|
|
||||||
app.use(cors());
|
|
||||||
|
|
||||||
// 匹配接口路由
|
|
||||||
app.use("/", routerIndex);
|
|
||||||
25
frontEnd/vite.config.ts
Normal file
25
frontEnd/vite.config.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import { defineConfig } from "vite";
|
||||||
|
import vue from "@vitejs/plugin-vue";
|
||||||
|
import { join } from "path";
|
||||||
|
|
||||||
|
// https://vitejs.dev/config/
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [vue()],
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
"@": join(__dirname, "/src"),
|
||||||
|
},
|
||||||
|
extensions: [".js", ".vue"],
|
||||||
|
},
|
||||||
|
server: {
|
||||||
|
host: true,
|
||||||
|
},
|
||||||
|
css: {
|
||||||
|
preprocessorOptions: {
|
||||||
|
scss: {
|
||||||
|
api: "modern",
|
||||||
|
silenceDeprecations: ["legacy-js-api"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user