Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

后端的代码可以开源吗 #3

Open
mariotong opened this issue May 12, 2017 · 5 comments
Open

后端的代码可以开源吗 #3

mariotong opened this issue May 12, 2017 · 5 comments

Comments

@mariotong
Copy link

智能机器人那块的接口,你后端也是调用别人的吗

@microzz
Copy link
Owner

microzz commented May 12, 2017

@mariotong 你好,后端部分在 https://github.com/microzz/vue-chat/blob/master/build/dev-server.js 真正机器人、IP定位部分调用了我自己的接口,这个在代码里可以看到接口,自己封装了起来,后端代理了一下,其实用的是图灵机器人,IP定位用了百度的服务,这两个接口都已经开放,地址在应用里面

@shijunti19
Copy link

@microzz 有koa版本的吗

@microzz
Copy link
Owner

microzz commented May 18, 2017

@mariotong 你好,koa是我自己线上版本。部分后端代码肯定不能开源的,你可以使用我封装的几个接口,代码中有

@l20
Copy link

l20 commented Sep 20, 2017

我代码是这样的:

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实现呢?感激不尽。

@aermin
Copy link

aermin commented Dec 18, 2017

请教下 vue-cli 不支持 koa么? 不然express和koa都要写的话成本有点大吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants