Git Product home page Git Product logo

werewolf's Introduction

API接口文档

端口

export const CLIENT_BASE_URL = "http://localhost:5173";
export const SERVER_BASE_URL = "http://localhost:3011";

关于cor解决跨域

有关房间密码加密

有关socket.io

有关token

createRoom.ts中房主创建房间之后把房主的ID和房间号放入token中

然后initRoom向后端发送post请求时把token中的id和roomNumber放入request header中,在用axios封装的请求拦截器中。

后端RoomModel

  • class Room会有一个静态私有属性private static roomMap存放着各个房间。

Koa中router.allowedMethods()中间件的作用

在加了router.allowedMethods()中间件情况下,如果接口是get请求,而前端使用post请求,会返回405 Method Not Allowed ,提示方法不被允许 ,并在响应头有添加允许的请求方式;而在不加这个中间件这种情况下,则会返回 404 Not Found找不到请求地址,并且响应头没有添加允许的请求方式 。

shared

httpMsg

  • httpResTemplate:用一个泛型T来限定传入data的类型。

werewolf's People

Contributors

gaoachao avatar

Watchers

 avatar

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.