From 90ed424d9961153b2bcc0108c35a6c27cc33cc3f Mon Sep 17 00:00:00 2001 From: denis Date: Sat, 27 Mar 2021 10:04:36 +0200 Subject: [PATCH] Final --- .idea/.gitignore | 5 +++++ index.js | 9 ++++++++ model.js | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 19 +++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 index.js create mode 100644 model.js create mode 100644 package.json diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/index.js b/index.js new file mode 100644 index 0000000..09fe6dd --- /dev/null +++ b/index.js @@ -0,0 +1,9 @@ +const express = require('express'); +const app=express(); +const port = 3000; + +app.get('/', (req, res) => { + res.json({msg: "Hello, world"}).send(); +}) + +app.listen(port, () => console.log('Server started')) \ No newline at end of file diff --git a/model.js b/model.js new file mode 100644 index 0000000..1c3c5bb --- /dev/null +++ b/model.js @@ -0,0 +1,53 @@ +const DataModel = { + "denys.denys@ukma.edu.ua": { + "fullName": "Denys Denys Denys", + "faculty": "FI", + "specialty": "Computer Science", + "year": 2, + "semesters": [ + { + "semester": 1, + "subjects": [ + { + "name": "Blockchain and cryptocurrencies", + "lector": "lector@ukma.edu.ua", + "mark": 80, + "topics": [ + { + "title": "Bitcoin", + "mark": 25 + }, + { + "title": "Hyperledger Fabric", + "mark": 25 + }, + { + "title": "Ethereum", + "mark": 30 + } + ] + }, + { + "name": "Computer Science", + "lector": "lector@ukma.edu.ua", + "mark": 99, + "topics": [ + { + "title": "Java", + "mark": 33 + }, + { + "title": "C#", + "mark": 33 + }, + { + "title": "C++", + "mark": 33 + }, + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..710d2b4 --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "untitled", + "version": "1.0.0", + "description": "Node.js API server", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [ + "hyperledger", + "api", + "blockchain" + ], + "author": "Denys Chelombitko", + "license": "ISC", + "dependencies": { + "express": "^4.17.1" + } +}