Comments (5)
@mariotong 你好,后端部分在 https://github.com/microzz/vue-chat/blob/master/build/dev-server.js 真正机器人、IP定位部分调用了我自己的接口,这个在代码里可以看到接口,自己封装了起来,后端代理了一下,其实用的是图灵机器人,IP定位用了百度的服务,这两个接口都已经开放,地址在应用里面
from vue-chat.
@microzz 有koa版本的吗
from vue-chat.
@mariotong 你好,koa是我自己线上版本。部分后端代码肯定不能开源的,你可以使用我封装的几个接口,代码中有
from vue-chat.
我代码是这样的:
const Koa = require('koa');
const app = new Koa();
const server = require('http').Server(app.callback());
const io = require('socket.io')(server);
io.on('connection', function(socket){
io.emit('this', { will: 'be received by everyone'});
socket.on('private message', function (from, msg) {
console.log('I received a private message by ', from, ' saying:', msg);
});
socket.on('disconnect', function () {
io.emit('user disconnected');
});
});
但是前端请求不到数据,该如何做呢,能否指导下如何koa2实现呢?感激不尽。
from vue-chat.
请教下 vue-cli 不支持 koa么? 不然express和koa都要写的话成本有点大吧
from vue-chat.
Related Issues (12)
- 貌似本地不能运行了 HOT 4
- 你好,这些表情是从哪里找的?怎么可以其他表情! HOT 2
- 你好,'https://zhaoplus.com/api/ip' 这个接口可以正常使用吗?接口连接不上
- 原来,后端不开源,秀啊。。。
- 建议 HOT 4
- build之后,程序无法正常访问 HOT 5
- 本地npm start 之后显示localhost拒绝访问 HOT 5
- 新手 问下安装的事情 HOT 1
- 服务器挂了 HOT 2
- 付费请大佬帮忙部署!
- 运行不了
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-chat.