Files
tf_docs/server.js
T

29 lines
608 B
JavaScript

'use strict';
const http = require('http');
const PORT = process.env.PORT || 3000;
const VERSION = process.env.APP_VERSION || '0.0.0';
const SERVICE = 'tf-docs';
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/html; charset=utf-8');
res.end(`<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>${SERVICE}</title>
</head>
<body>
<h1>${SERVICE}</h1>
<p>version: ${VERSION}</p>
</body>
</html>
`);
});
server.listen(PORT, () => {
console.log(`[${SERVICE}] listening on :${PORT} (version ${VERSION})`);
});