multy-stub/server/root.js
2024-05-18 11:39:16 +03:00

19 lines
461 B
JavaScript

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 v${pkg.version}</h1>
<ul>
${folders.map((f) => `<li>${f}</li>`).join('')}
</ul>
`)
})
module.exports = router