vi /etc/sysconfig/network-scripts/ifcfg-eth0 TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"| { | |
| "name": "ilberHocaBot", | |
| "version": "0.0.1", | |
| "description": "Node Server", | |
| "main": "app.js", | |
| "author": "İlker Eroğlu", | |
| "license": "MIT", | |
| "dependencies": { | |
| "express": "^4.x.x", | |
| "body-parser": "^1.x.x", |
| var express = require('express'); | |
| var bodyParser = require('body-parser'); | |
| var app = express(); | |
| var port = process.env.PORT || 1666; | |
| app.use(bodyParser.urlencoded({ extended: true })); | |
| app.get('/', function (req, res) { | |
| res.status(200).send('Çalışıyor...'); |
| app.post('/selam', function (req, res, next) { | |
| var userName = req.body.user_name; | |
| var bot = { | |
| text : userName + 'Ooo cahil bey hoşgeldiniz.' | |
| }; | |
| if (userName !== 'slackbot') { | |
| return res.status(200).json(bot); | |
| } else { | |
| return res.status(200).end(); |
| web: node app |
Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".
Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).
Let's dig in:
I hereby claim:
To claim this, I am signing this object: