add version to root

This commit is contained in:
Primakov Alexandr Alexandrovich 2024-05-18 11:39:16 +03:00
parent 954938d6a9
commit db1cbf6554

View File

@ -1,13 +1,14 @@
const router = require('express').Router()
const fs = require('fs')
const path = require('path')
const pkg = require('../package.json')
const folderPath = path.resolve(__dirname, './routers')
const folders = fs.readdirSync(folderPath)
router.get('/', (req, res) => {
res.send(`
<h1>multy stub is working</h1>
<h1>multy stub is working v${pkg.version}</h1>
<ul>
${folders.map((f) => `<li>${f}</li>`).join('')}
</ul>