Personal knowledge management
npm install
在app目录下新建文件 .mongo.config.ts
,输入一下内容:
const mongoConfig = `mongodb:https://用户名:${encodeURIComponent('密码')}@地址:端口/库名`
export default mongoConfig
修改 app/install.ts
中对应的信息
npm run app-install
npm run dev
https://localhost:3000 -> FE
https://localhost:4000 -> KOA server
建议使用PM2,全局安装pm2 npm install pm2 -g
npm run build
npm start
# npm run start-docker
入口文件为 ./www/app.js
import { getCurrentInstance, ComponentInternalInstance, ref } from 'vue'
const { appContext } = getCurrentInstance() as ComponentInternalInstance
const { $axios } = appContext.config.globalProperties
$axios.get('/api/documents').then((res: any) => {
console.log(res)
})