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