diff --git a/server/routers/freetracker/index.js b/server/routers/freetracker/index.js index 3d621fe..4c2ebed 100644 --- a/server/routers/freetracker/index.js +++ b/server/routers/freetracker/index.js @@ -1,5 +1,6 @@ const router = require('express').Router(); router.use('/performer', require('./dashboard-performer')) +router.use('/landing', require('./landing')) module.exports = router; \ No newline at end of file diff --git a/server/routers/freetracker/landing/index.js b/server/routers/freetracker/landing/index.js new file mode 100644 index 0000000..9e0cdf2 --- /dev/null +++ b/server/routers/freetracker/landing/index.js @@ -0,0 +1,29 @@ +const Router = require('express').Router; + +const router = Router() + +const values = { + 'blocks': 'success', + 'application': 'success' +} + +const timer = (_req, _res, next) => { + setTimeout(() => next(), 500) +} + +router.use(timer) + +router.get( + '/blocks', + (req, res) => + res.send(require(`./json/blocks-${values['blocks']}.json`)) +) + +router.post( + '/application', + (req, res) => { + res.send(require(`./json/application-${values['application']}.json`)) + } +) + +module.exports = router \ No newline at end of file diff --git a/server/routers/freetracker/landing/json/application-error.json b/server/routers/freetracker/landing/json/application-error.json new file mode 100644 index 0000000..7f63ddc --- /dev/null +++ b/server/routers/freetracker/landing/json/application-error.json @@ -0,0 +1,7 @@ +{ + "success": false, + "body": { }, + "errors": [ + "Что-то пошло не так" + ] +} \ No newline at end of file diff --git a/server/routers/freetracker/landing/json/application-success.json b/server/routers/freetracker/landing/json/application-success.json new file mode 100644 index 0000000..05858a5 --- /dev/null +++ b/server/routers/freetracker/landing/json/application-success.json @@ -0,0 +1,4 @@ +{ + "success": true, + "body": { } +} \ No newline at end of file diff --git a/server/routers/freetracker/landing/json/blocks-error.json b/server/routers/freetracker/landing/json/blocks-error.json new file mode 100644 index 0000000..44f8352 --- /dev/null +++ b/server/routers/freetracker/landing/json/blocks-error.json @@ -0,0 +1,9 @@ +{ + "success": false, + "body": { + "blocks": [] + }, + "errors": [ + "Что-то пошло не так" + ] +} \ No newline at end of file diff --git a/server/routers/freetracker/landing/json/blocks-success.json b/server/routers/freetracker/landing/json/blocks-success.json new file mode 100644 index 0000000..5db16ad --- /dev/null +++ b/server/routers/freetracker/landing/json/blocks-success.json @@ -0,0 +1,22 @@ +{ + "success": true, + "body": { + "blocks": [ + { + "titleKey":"block1.title", + "textKey":"block1.subtitle", + "imageName":"truck1" + }, + { + "titleKey":"block2.title", + "textKey":"block2.subtitle", + "imageName":"truck2" + }, + { + "titleKey":"block3.title", + "textKey":"block3.subtitle", + "imageName":"truck3" + } + ] + } +} \ No newline at end of file