Chrome应用插件

有可能会出现服务器限制跨域,即在插件上输入了推送链接,但是没有反应
这时候需要到服务器里面找到server.js
在第20行添加一下内容

app.use(function (req, res, next) {
  // Website you wish to allow to connect
  res.setHeader('Access-Control-Allow-Origin', '*');

  // Request methods you wish to allow
  res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');

  // Request headers you wish to allow
  res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');

  // Set to true if you need the website to include cookies in the requests sent
  // to the API (e.g. in case you use sessions)
  res.setHeader('Access-Control-Allow-Credentials', true);

  // Pass to next layer of middleware
  next();
})

然后cd /文件所在位置,例如cd /root/tg_push_bot
然后重启pm2 pm2 restart all