const http = require('http');
const url = require('url');
// load config file
const config = require(process.cwd() + '/config.json');
function outputHTML5(status, response, content, title)
{
response.writeHead(status, { 'Content-Type': 'text/html; charset=utf-8' });
response.write(
`
${title}
${content}
`
);
response.end();
}
var server = http.createServer(function (request, response) {
if(request.url === "/") {
content = config.staging.config_id;
outputHTML5(200,response,content,"Server info");
}
else {
outputHTML5(404,response,'Y\'a rien ici',"Oups");
}
});
server.listen(80);