Giter VIP home page Giter VIP logo

Comments (5)

microzz avatar microzz commented on May 12, 2024 1

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

from vue-chat.

shijunti19 avatar shijunti19 commented on May 12, 2024

@microzz 有koa版本的吗

from vue-chat.

microzz avatar microzz commented on May 12, 2024

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

from vue-chat.

l20 avatar l20 commented on May 12, 2024

我代码是这样的:

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.

aermin avatar aermin commented on May 12, 2024

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

from vue-chat.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.