From 6d3e6c78cb367919daafcb08c84487751047dee9 Mon Sep 17 00:00:00 2001 From: BananchickPasha Date: Sat, 27 Mar 2021 00:28:10 +0200 Subject: [PATCH] Pavlo Vlasenko: create app.js --- app.js | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 app.js diff --git a/app.js b/app.js new file mode 100644 index 0000000..d347a03 --- /dev/null +++ b/app.js @@ -0,0 +1,76 @@ +const express = require('express') +const app = express() +const port = 3000 +app.get('/', (req, res) => { + res.send('Hello World!') +}) +app.get('/workers', (req, res) => { + res.send(model.workers) +}) +app.get('/subjects', (req, res) => { + res.send(model.subjects) +}) +app.get('/faculties', (req, res) => { + res.send(model.faculties) +}) +app.get('/students', (req, res) => { + res.send(model.students) +}) + +app.listen(port, () => { + console.log(`Example app listening at http://localhost:${port}`) +}) + +model={ + subjects:{ + "Blockchain":{ + id: 1, + fullName:"Основи блокчейн та криптовалют", + credits:2, + workload:4, + facultyId: 1, + } + }, + faculties: { + "FI": { + id: 1, + fullName: "Факультет Інформатики", + } + }, + workers: { + "First": { + id: 1, + fullName: "Є.І. Невмержицький" + }, + "Second": { + id:2, + fullName: "К.С. Гороховський" + } + }, + students:{ + "Pavlo Vlasenko":{ + name:"Pavlo Vlasenko", + id: 1, + facultyId: 1, + semesters:{ + "autumn":{ + subjects:{ + "Blockchain":{ + subjId: 1, + lectorId: 1, + practiceId:2, + marks:[2,2,2,1], + bonusMarks:[0,0], + attendance:{ + practice:0, + lecture: 0 + }, + finalMark:61, + } + } + } + } + } + } + } +