Merge branch 'feature/lobsters1' of inno-js/multy-stub into master
This commit is contained in:
commit
73ececf944
@ -40,6 +40,7 @@ app.use(require('./root'))
|
|||||||
/**
|
/**
|
||||||
* Добавляйте сюда свои routers.
|
* Добавляйте сюда свои routers.
|
||||||
*/
|
*/
|
||||||
|
app.use('/lobsters', require('./routers/lobsters'))
|
||||||
app.use('/example', require('./routers/example'))
|
app.use('/example', require('./routers/example'))
|
||||||
// app.use('/coder', require('./routers/coder'))
|
// app.use('/coder', require('./routers/coder'))
|
||||||
app.use('/stc-21-03', require('./routers/stc-21-03'))
|
app.use('/stc-21-03', require('./routers/stc-21-03'))
|
||||||
|
13
server/routers/lobsters/index.js
Normal file
13
server/routers/lobsters/index.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
const router = require('express').Router()
|
||||||
|
|
||||||
|
const first = router.get('/allcourses', (req, res) => {
|
||||||
|
res.send(require('./stubs/allCourses.json'))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Этот эндпоинт будет доступен по адресу http://89.223.91.151:8080/multystub/example/first
|
||||||
|
*/
|
||||||
|
})
|
||||||
|
|
||||||
|
router.use('/example-api', first)
|
||||||
|
|
||||||
|
module.exports = router
|
22
server/routers/lobsters/stubs/allCourses.json
Normal file
22
server/routers/lobsters/stubs/allCourses.json
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"body": {
|
||||||
|
"availableCourses": [
|
||||||
|
{
|
||||||
|
"id": "1",
|
||||||
|
"title": "Основы JS (difficulty 1)",
|
||||||
|
"duration": "6 месяцев",
|
||||||
|
"difficulty": 1,
|
||||||
|
"startDate": "2023-04-14T12:54:01.174Z",
|
||||||
|
"endDate": "2023-12-14T12:54:01.174Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "2",
|
||||||
|
"title": "Основы JS (difficulty 2)",
|
||||||
|
"duration": "6 месяцев",
|
||||||
|
"difficulty": 2,
|
||||||
|
"startDate": "2023-04-14T12:54:01.174Z",
|
||||||
|
"endDate": "2023-10-14T12:54:01.174Z"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user