Coder Social home page Coder Social logo

foreverwyq / nodejs-back-template Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 73 KB

Nodejs-template-back is a minimalist framework that can quickly build nodejs interface services. It is compressed and packaged by webpack, encapsulates websocket, httpserve, file operation, mysql access and other methods, and has a complete interface routing system.

License: MIT License

JavaScript 100.00%

nodejs-back-template's People

Contributors

foreverwyq avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

xiaolaodi-x

nodejs-back-template's Issues

websocket优化问题

1.在ws.createServer方法里需要用箭头函数否则this指向会有问题
2.未写存储userSocketItem的方法
3.sendJson里sendSocketList遍历的socket需要解构
4.需要为大量socket的同时存在的情况,考虑一下效率问题。需要优化

关于路由优化问题

src/utils/router.js,这块若有需要扩展一个统一文根的话可以考虑一下优化

优化问题

const server = require('./server');
const WebSocket = require('./webSocket/index');

console.log(process.env.NODE_ENV);
const ws = new WebSocket(8081);
server(ws, 8080);

可以加个全局变量存储常量

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.