feat: minimal tf-docs nodejs skeleton (empty page, v0.0.0)
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"name": "tf-docs",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"description": "Terraform docs service (S3 static /docs) — initial skeleton",
|
||||||
|
"main": "server.js",
|
||||||
|
"scripts": {
|
||||||
|
"start": "node server.js",
|
||||||
|
"check": "node -c server.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
'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})`);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user