terraform-provider-docker/scripts/testing/server_v2.js
Manuel Vogel d7038e7560 Feat/swarm 3 acc test infra (#39)
* Set up test infrastructure with local registry and custom images.

* Updated travis docker version and usage of new test infra.

* Made acc tests constantly output test results.

* Tmp acc test files are ignored.

* Fixed tests with new infra.

* Allowing insecure registries for acc tests. Added fallback for v1 registries.

* Added private image cleanup after tests.

* Refined acc test structure to confirm tf provider standards with make testacc.
2018-02-09 13:11:30 -06:00

20 lines
567 B
JavaScript

var http = require('http');
var configs = require('./configs')
var secrets = require('./secrets')
var handleRequest = function(request, response) {
console.log('Received request for URL: ' + request.url);
if(request.url === '/health') {
response.writeHead(200);
response.end('ok');
} else if(request.url === '/newroute') {
response.writeHead(200);
response.end('new Route!');
} else {
response.writeHead(200);
response.end(configs.prefix + ' - Hello World!');
}
};
var www = http.createServer(handleRequest);
www.listen(8080);