Giter VIP home page Giter VIP logo

my-koa's Introduction

my-koa

# 初始化pm2配置文件
pm2 init simple
# 使用配置文件启动
pm2 start ecosystem.config.js
# 列出进程
pm2 list
# 关闭进程
pm2 kill

redis

# redis服务端启动
redis-server.exe redis.windows.conf

# 客户端连接
redis-cli.exe -h 127.0.0.1 -p 6379
# 选择数据库,默认16个,选择第8个
select 8
# 设置值
set hello 1234
# 获取值
get hello

配置 redis.windows.conf 密码

requirepass 123456

nginx

# 启动
start nginx
# 关闭
nginx -s stop

tasklist |findstr nginx.exe

taskkill /f /t /pid 17444

配置代理地址

location /api/{
   proxy_pass http://localhost:4000/;
            #代理ip地址
   proxy_set_header X-Real-IP $remote_addr;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }

websocket

node ws.js

静态资源服务

node static.js

后台代理转发,去除iframe嵌套限制

node uniframe.js
<iframe
      sandbox="allow-popups allow-same-origin allow-scripts"
      src="http://127.0.0.1:10101/index.html"
    ></iframe>

服务端推送

https://www.ruanyifeng.com/blog/2017/05/server-sent_events.html

node serverPush.js

Tab之间通信

https://developer.mozilla.org/zh-CN/docs/Web/API/BroadcastChannel

localstorage和onstorage通信

my-koa's People

Contributors

xiaolidan00 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.