Just because Node is designed without threads, doesn't mean you cannot take advantage of multiple cores in your environment. Child processes can be spawned by using our child_process.fork() API, and are designed to be easy to communicate with. Built upon that same interface is the cluster module, which allows you to share sockets between processes to enable load balancing over your cores.
<td style="text-align:center;">
<input type="button" id="show-modal"
class="Insp"
v-bind:name="{{order.mod.real|safeseq}}"
text="{{order.mod.port}}"
test="{{order.mod.id}}"
@click="open(order.mod.real|safeseq)" value="Открыть">
</td>
methods:{
open(name){
var self = this
self.selecIP=name
}
}
module.exports.getUser = (req, res) => {
if (req.isAuthenticated() && req.user.role == 'user')
res.render('user');
}
module.exports.postChangeRole = (req, res) => {
console.log(req.body);
pg.connect(connectionString, function (err, client, done) {
console.log(req);
if (err) {
return console.error('error feetching client from pool', err);
}
client.query('UPDATE items SET role=($1), change=($2) WHERE name=($3)', [req.body.role,
req.body.role == 'user' ? 'true' : 'false', req.body.name]);
done();
});
}
var handlers=require('./handlers');
app.get('/user', handlers.getUser);
app.post('/changeRole',handlers.postChangeRole);