root@noderelay:/opt/bc-relay# cat ecosystem.yml
apps:
- script: /opt/bc-relay/index.js
name: "app"
max_memory_restart: '500M'
exec_mode: "cluster"
let noft = await vk.call('messages.getConversationMembers', {
peer_id: msg.message.peer_id,
fields: 'id, first_name',
group_id: 193658885
});
noft.items.forEach(element => {
if (element.member_id > 0){
console.log("[id" + element.member_id.join('') + '|@]')
// messagesend('[id' + element.member_id + '|@]')
}
});
socket.on('connect', function () {
socket.emit('join', {email: user@example.com});
});
io.on('connection', function (socket) {
socket.on('join', function (data) {
socket.join(data.email);
});
});
io.to('user@example.com').emit('message', {msg: 'hello world.'});
socket.on("message", function(data) {
alert(data.msg);
});
function docker_tag_exists() {
curl --silent -f -lSL https://index.docker.io/v1/repositories/$1/tags/$2 > /dev/null
}
if docker_tag_exists library/nginx 1.7.5; then
echo exist
else
echo not exists
fi
const http = require('http');
const fs = require('fs');
const file = fs.createWriteStream("file.jpg");
const request = http.get("http://test.ru/text.txt ", function(response) {
response.pipe(file);
});
const http = require('http');
var downFile = "";
const request = http.get("http://test.ru/text.txt ", function(response) {
downFile(response);
});