mongoose + tests

This commit is contained in:
Primakov Alexandr Alexandrovich
2024-10-16 11:06:23 +03:00
parent 2cfcd7347b
commit 4b0d9b4dbc
1295 changed files with 4579 additions and 1719 deletions
+30
View File
@@ -0,0 +1,30 @@
const router = require('express').Router()
router.get('/gettopic/:topic/:section', (request, response) => {
const topic = request.params.topic
let section = request.params.section
if (!topic || !section) {
response.send(require('./error.json'))
} else {
response.send(
// require(`./${topic}/${section}.json`)
require(`./dynamic-programming/${section}.json`),
)
}
})
router.get('/gettopic/:topic', (request, response) => {
const topic = request.params.topic
if (!topic) {
response.send(require('./error.json'))
} else {
response.send(
// require(`./${topic}.json`)
require('./dynamic-programming.json'),
)
}
})
module.exports = router