- php- :
php:
image: php:apache
environment:
- VIRTUAL_HOST=api.localhost
volumes:
- ./php:/var/www/html
:
curl -H 'Host: api.localhost' http://localhost:8000/api
. , , DNS /etc/hosts :
127.0.0.1 api.localhost
, :
curl -H http://api.localhost:8000/api
, , node:
var request = require('request')
var formData = {}
request({
headers: {
'Host': 'api.localhost'
},
uri: 'http://localhost:8080',
method: 'POST'
}, function (err, res, body) {
console.log("it works")
console.log(res)
}
)
/etc/hosts, (DNS-). node.