vue-chat-lib
v0.0.3
Published
``` npm i vue-chat-lib -S
Readme
Install pacakge from npm registry
npm i vue-chat-lib -S
or
yarn add vue-chat-lib -S
Use package in vue3 project
register package
import Chatlib from 'vue-chat-lib'
const app = createApp(App)
app.use(Chatlib)
Use it in corresponding page
<template>
<ChatBox topic="eProjects" />
</template>
COnfig the API router, ensure you can access the chat api.
add the following proxy to the vite.config.js or vue.config.js
server: {
proxy: {
'/front': {
target: 'http://10.227.11.21:8000',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/front/, ''),
configure: (proxy, options) => {
proxy.on('proxyReq', (proxyReq) => {
proxyReq.setHeader('Connection', '');
});
}
}
}
}
add the following configuration item to the nginx.conf
location ^~/front/ {
proxy_pass http://10.227.11.21:8000/;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
