This commit is contained in:
2022-02-07 07:29:07 +01:00
parent 88293c1e34
commit 61dd1649fd
14 changed files with 645 additions and 3399 deletions

2
.vscode/launch.json vendored
View File

@ -11,7 +11,7 @@
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\bin\\www"
"program": "${workspaceFolder}/bin/www"
}
]
}

6
app.js
View File

@ -5,7 +5,8 @@ var cookieParser = require('cookie-parser');
var logger = require('morgan');
var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
var usersRouter = require('./routes/user');
var messagesRouter = require('./routes/message');
var app = express();
@ -22,7 +23,8 @@ app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', indexRouter);
app.use('/users', usersRouter);
app.use('/user', usersRouter);
app.use('/message', messagesRouter);
// catch 404 and forward to error handler
app.use(function(req, res, next) {

Binary file not shown.

View File

@ -1,7 +1,7 @@
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('Users', {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('Users', {
id: {
allowNull: false,
autoIncrement: true,
@ -27,7 +27,7 @@ module.exports = {
}
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('Users');
async down(queryInterface, Sequelize) {
await queryInterface.dropTable('Users');
}
};

View File

@ -0,0 +1,30 @@
'use strict';
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('Messages', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
owner: {
type: Sequelize.INTEGER
},
body: {
type: Sequelize.STRING
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
},
async down(queryInterface, Sequelize) {
await queryInterface.dropTable('Messages');
}
};

View File

@ -20,10 +20,13 @@ fs
return (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js');
})
.forEach(file => {
var model = require(path.join(__dirname, file))(sequelize, Sequelize.DataTypes)
var model = require(path.join(__dirname, file))(sequelize, Sequelize.DataTypes);
db[model.name] = model;
});
db.Message.belongsTo(db.User, {foreignKey: "id", as: "messages"});
db.User.hasMany(db.Message, {oreignKey: "id", as: "owner"});
Object.keys(db).forEach(modelName => {
if (db[modelName].associate) {
db[modelName].associate(db);

25
models/message.js Normal file
View File

@ -0,0 +1,25 @@
'use strict';
const User = require('./user').User;
const {
Model
} = require('sequelize');
module.exports = (sequelize, DataTypes) => {
class Message extends Model {
/**
* Helper method for defining associations.
* This method is not a part of Sequelize lifecycle.
* The `models/index` file will call this method automatically.
*/
static associate(models) {
// define association here
}
}
Message.init({
owner: DataTypes.INTEGER,
body: DataTypes.STRING
}, {
sequelize,
modelName: 'Message',
});
return Message;
};

5
models/relations.js.old Normal file
View File

@ -0,0 +1,5 @@
const Message = require('./message').Message;
const User = require('./user').User;
Message.belongsTo(User, {foreignKey: "id", as: "messages"});
User.hasMany(Message, {oreignKey: "id", as: "owner"});

View File

@ -1,15 +1,32 @@
'use strict';
const Message = require('./message');
const {
Model
} = require('sequelize');
module.exports = (sequelize, DataTypes) => {
var User = sequelize.define('User', {
class User extends Model {
/**
* Helper method for defining associations.
* This method is not a part of Sequelize lifecycle.
* The `models/index` file will call this method automatically.
*/
static associate(models) {
// define association here
}
}
User.init({
name: DataTypes.STRING,
password: DataTypes.STRING,
email: DataTypes.STRING
}, {
classMethods: {
associate: function(models) {
// associations can be defined here
}
}
sequelize,
modelName: 'User',
});
return User;
};
// const Message = require('./message').Message;
// Message.belongsTo(User, {foreignKey: "id", as: "messages"});
// User.hasMany(Message, {oreignKey: "id", as: "owner"});

3392
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,7 @@
},
"devDependencies": {
"postcss": "^8.4.6",
"sequelize-cli": "^6.4.1",
"tailwind-scrollbar": "^1.3.1",
"tailwindcss": "^3.0.18"
}

View File

@ -423,11 +423,6 @@ Ensure the default browser behavior of the `hidden` attribute.
display: none;
}
* {
scrollbar-color: initial;
scrollbar-width: initial;
}
*, ::before, ::after {
--tw-translate-x: 0;
--tw-translate-y: 0;
@ -498,50 +493,30 @@ Ensure the default browser behavior of the `hidden` attribute.
top: -2.5rem;
}
.right-0 {
right: 0px;
}
.z-50 {
z-index: 50;
}
.z-10 {
z-index: 10;
}
.m-5 {
margin: 1.25rem;
}
.m-2 {
margin: 0.5rem;
}
.mx-auto {
margin-left: auto;
margin-right: auto;
}
.my-4 {
margin-top: 1rem;
margin-bottom: 1rem;
}
.mx-2 {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.my-4 {
margin-top: 1rem;
margin-bottom: 1rem;
}
.my-5 {
margin-top: 1.25rem;
margin-bottom: 1.25rem;
}
.mt-2 {
margin-top: 0.5rem;
}
.mt-5 {
margin-top: 1.25rem;
}
@ -550,14 +525,6 @@ Ensure the default browser behavior of the `hidden` attribute.
margin-right: 0.5rem;
}
.mr-4 {
margin-right: 1rem;
}
.mb-4 {
margin-bottom: 1rem;
}
.mr-3 {
margin-right: 0.75rem;
}
@ -566,30 +533,22 @@ Ensure the default browser behavior of the `hidden` attribute.
margin-top: 0.75rem;
}
.ml-2 {
margin-left: 0.5rem;
.mb-4 {
margin-bottom: 1rem;
}
.-mr-1 {
margin-right: -0.25rem;
.mr-4 {
margin-right: 1rem;
}
.block {
display: block;
}
.inline-block {
display: inline-block;
}
.flex {
display: flex;
}
.inline-flex {
display: inline-flex;
}
.hidden {
display: none;
}
@ -598,42 +557,10 @@ Ensure the default browser behavior of the `hidden` attribute.
height: 1.5rem;
}
.h-32 {
height: 8rem;
}
.h-64 {
height: 16rem;
}
.h-full {
height: 100%;
}
.h-16 {
height: 4rem;
}
.h-20 {
height: 5rem;
}
.h-28 {
height: 7rem;
}
.h-36 {
height: 9rem;
}
.h-4 {
height: 1rem;
}
.h-5 {
height: 1.25rem;
}
.max-h-40 {
max-height: 10rem;
}
@ -650,58 +577,18 @@ Ensure the default browser behavior of the `hidden` attribute.
width: 100%;
}
.w-44 {
width: 11rem;
}
.w-4 {
width: 1rem;
}
.w-56 {
width: 14rem;
}
.w-5 {
width: 1.25rem;
.max-w-lg {
max-width: 32rem;
}
.max-w-xl {
max-width: 36rem;
}
.max-w-lg {
max-width: 32rem;
}
.flex-1 {
flex: 1 1 0%;
}
.flex-shrink-0 {
flex-shrink: 0;
}
.origin-top-right {
transform-origin: top right;
}
.scale-95 {
--tw-scale-x: .95;
--tw-scale-y: .95;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.scale-100 {
--tw-scale-x: 1;
--tw-scale-y: 1;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.transform {
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.list-none {
list-style-type: none;
}
@ -749,28 +636,10 @@ Ensure the default browser behavior of the `hidden` attribute.
overflow-y: scroll;
}
.truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.rounded-md {
border-radius: 0.375rem;
}
.rounded-full {
border-radius: 9999px;
}
.rounded {
border-radius: 0.25rem;
}
.rounded-lg {
border-radius: 0.5rem;
}
.border {
border-width: 1px;
}
@ -779,11 +648,6 @@ Ensure the default browser behavior of the `hidden` attribute.
border-bottom-width: 1px;
}
.border-gray-300 {
--tw-border-opacity: 1;
border-color: rgb(209 213 219 / var(--tw-border-opacity));
}
.border-b-gray-400 {
--tw-border-opacity: 1;
border-bottom-color: rgb(156 163 175 / var(--tw-border-opacity));
@ -794,9 +658,9 @@ Ensure the default browser behavior of the `hidden` attribute.
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
}
.bg-blue-500 {
.bg-gray-700 {
--tw-bg-opacity: 1;
background-color: rgb(59 130 246 / var(--tw-bg-opacity));
background-color: rgb(55 65 81 / var(--tw-bg-opacity));
}
.bg-blue-600 {
@ -804,44 +668,14 @@ Ensure the default browser behavior of the `hidden` attribute.
background-color: rgb(37 99 235 / var(--tw-bg-opacity));
}
.bg-gray-600 {
--tw-bg-opacity: 1;
background-color: rgb(75 85 99 / var(--tw-bg-opacity));
}
.bg-gray-900 {
--tw-bg-opacity: 1;
background-color: rgb(17 24 39 / var(--tw-bg-opacity));
}
.bg-gray-400 {
.bg-gray-600 {
--tw-bg-opacity: 1;
background-color: rgb(156 163 175 / var(--tw-bg-opacity));
}
.bg-blue-400 {
--tw-bg-opacity: 1;
background-color: rgb(96 165 250 / var(--tw-bg-opacity));
}
.bg-gray-500 {
--tw-bg-opacity: 1;
background-color: rgb(107 114 128 / var(--tw-bg-opacity));
}
.bg-gray-700 {
--tw-bg-opacity: 1;
background-color: rgb(55 65 81 / var(--tw-bg-opacity));
}
.bg-blue-700 {
--tw-bg-opacity: 1;
background-color: rgb(29 78 216 / var(--tw-bg-opacity));
}
.bg-gray-100 {
--tw-bg-opacity: 1;
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
background-color: rgb(75 85 99 / var(--tw-bg-opacity));
}
.object-none {
@ -866,10 +700,6 @@ Ensure the default browser behavior of the `hidden` attribute.
padding: 1.25rem;
}
.p-2 {
padding: 0.5rem;
}
.py-2 {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
@ -880,6 +710,16 @@ Ensure the default browser behavior of the `hidden` attribute.
padding-right: 0.5rem;
}
.py-1 {
padding-top: 0.25rem;
padding-bottom: 0.25rem;
}
.px-3 {
padding-left: 0.75rem;
padding-right: 0.75rem;
}
.px-5 {
padding-left: 1.25rem;
padding-right: 1.25rem;
@ -890,26 +730,6 @@ Ensure the default browser behavior of the `hidden` attribute.
padding-right: 1rem;
}
.py-1 {
padding-top: 0.25rem;
padding-bottom: 0.25rem;
}
.py-2\.5 {
padding-top: 0.625rem;
padding-bottom: 0.625rem;
}
.py-3 {
padding-top: 0.75rem;
padding-bottom: 0.75rem;
}
.px-3 {
padding-left: 0.75rem;
padding-right: 0.75rem;
}
.pl-2 {
padding-left: 0.5rem;
}
@ -926,14 +746,6 @@ Ensure the default browser behavior of the `hidden` attribute.
padding-right: 1.25rem;
}
.text-left {
text-align: left;
}
.text-center {
text-align: center;
}
.align-bottom {
vertical-align: bottom;
}
@ -948,55 +760,23 @@ Ensure the default browser behavior of the `hidden` attribute.
line-height: 1.75rem;
}
.text-base {
font-size: 1rem;
line-height: 1.5rem;
}
.font-bold {
font-weight: 700;
}
.font-medium {
font-weight: 500;
}
.text-gray-600 {
--tw-text-opacity: 1;
color: rgb(75 85 99 / var(--tw-text-opacity));
}
.text-white {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}
.text-gray-400 {
--tw-text-opacity: 1;
color: rgb(156 163 175 / var(--tw-text-opacity));
}
.text-gray-700 {
.text-white {
--tw-text-opacity: 1;
color: rgb(55 65 81 / var(--tw-text-opacity));
}
.text-gray-900 {
--tw-text-opacity: 1;
color: rgb(17 24 39 / var(--tw-text-opacity));
}
.text-blue-600 {
--tw-text-opacity: 1;
color: rgb(37 99 235 / var(--tw-text-opacity));
}
.opacity-0 {
opacity: 0;
}
.opacity-100 {
opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}
.shadow {
@ -1011,176 +791,16 @@ Ensure the default browser behavior of the `hidden` attribute.
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.shadow-lg {
--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.shadow-sm {
--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.ring-1 {
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}
.ring-black {
--tw-ring-opacity: 1;
--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity));
}
.ring-opacity-5 {
--tw-ring-opacity: 0.05;
}
.transition {
transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
.duration-100 {
transition-duration: 100ms;
}
.duration-75 {
transition-duration: 75ms;
}
.ease-out {
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}
.ease-in {
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.scrollbar {
--scrollbar-track: initial;
--scrollbar-thumb: initial;
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
overflow: overlay;
}
.scrollbar.overflow-x-hidden {
overflow-x: hidden;
}
.scrollbar.overflow-y-hidden {
overflow-y: hidden;
}
.scrollbar::-webkit-scrollbar-track {
background-color: var(--scrollbar-track);
}
.scrollbar::-webkit-scrollbar-thumb {
background-color: var(--scrollbar-thumb);
}
.scrollbar {
scrollbar-width: auto;
}
.scrollbar::-webkit-scrollbar {
width: 16px;
height: 16px;
}
.scrollbar-thin {
--scrollbar-track: initial;
--scrollbar-thumb: initial;
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
overflow: overlay;
}
.scrollbar-thin.overflow-x-hidden {
overflow-x: hidden;
}
.scrollbar-thin.overflow-y-hidden {
overflow-y: hidden;
}
.scrollbar-thin::-webkit-scrollbar-track {
background-color: var(--scrollbar-track);
}
.scrollbar-thin::-webkit-scrollbar-thumb {
background-color: var(--scrollbar-thumb);
}
.scrollbar-thin {
scrollbar-width: thin;
}
.scrollbar-thin::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.scrollbar-track-gray-\37 00 {
--scrollbar-track: #374151 !important;
}
.scrollbar-thumb-gray-\37 00 {
--scrollbar-thumb: #374151 !important;
}
.scrollbar-thumb-gray-\39 00 {
--scrollbar-thumb: #111827 !important;
}
.scrollbar-track-blue-\33 00 {
--scrollbar-track: #93c5fd !important;
}
.scrollbar-thumb-blue-\37 00 {
--scrollbar-thumb: #1d4ed8 !important;
}
.focus-within\:text-gray-400:focus-within {
--tw-text-opacity: 1;
color: rgb(156 163 175 / var(--tw-text-opacity));
}
.hover\:bg-gray-100:hover {
--tw-bg-opacity: 1;
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
}
.hover\:bg-blue-800:hover {
--tw-bg-opacity: 1;
background-color: rgb(30 64 175 / var(--tw-bg-opacity));
}
.hover\:bg-gray-50:hover {
--tw-bg-opacity: 1;
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
}
.hover\:bg-gray-400:hover {
--tw-bg-opacity: 1;
background-color: rgb(156 163 175 / var(--tw-bg-opacity));
}
.hover\:bg-gray-600:hover {
--tw-bg-opacity: 1;
background-color: rgb(75 85 99 / var(--tw-bg-opacity));
}
.hover\:underline:hover {
-webkit-text-decoration-line: underline;
text-decoration-line: underline;
}
.focus\:text-blue-400:focus {
--tw-text-opacity: 1;
color: rgb(96 165 250 / var(--tw-text-opacity));
@ -1191,36 +811,6 @@ Ensure the default browser behavior of the `hidden` attribute.
outline-offset: 2px;
}
.focus\:ring-4:focus {
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}
.focus\:ring-2:focus {
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}
.focus\:ring-blue-300:focus {
--tw-ring-opacity: 1;
--tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity));
}
.focus\:ring-indigo-500:focus {
--tw-ring-opacity: 1;
--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity));
}
.focus\:ring-offset-2:focus {
--tw-ring-offset-width: 2px;
}
.focus\:ring-offset-gray-100:focus {
--tw-ring-offset-color: #f3f4f6;
}
@media (prefers-color-scheme: dark) {
.dark\:bg-gray-800 {
--tw-bg-opacity: 1;
@ -1242,36 +832,11 @@ Ensure the default browser behavior of the `hidden` attribute.
background-color: rgb(75 85 99 / var(--tw-bg-opacity));
}
.dark\:bg-blue-600 {
--tw-bg-opacity: 1;
background-color: rgb(37 99 235 / var(--tw-bg-opacity));
}
.dark\:text-white {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}
.dark\:text-gray-200 {
--tw-text-opacity: 1;
color: rgb(229 231 235 / var(--tw-text-opacity));
}
.dark\:hover\:bg-gray-600:hover {
--tw-bg-opacity: 1;
background-color: rgb(75 85 99 / var(--tw-bg-opacity));
}
.dark\:hover\:bg-blue-700:hover {
--tw-bg-opacity: 1;
background-color: rgb(29 78 216 / var(--tw-bg-opacity));
}
.dark\:hover\:text-white:hover {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}
.dark\:focus\:bg-white:focus {
--tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
@ -1281,19 +846,9 @@ Ensure the default browser behavior of the `hidden` attribute.
--tw-text-opacity: 1;
color: rgb(17 24 39 / var(--tw-text-opacity));
}
.dark\:focus\:ring-blue-800:focus {
--tw-ring-opacity: 1;
--tw-ring-color: rgb(30 64 175 / var(--tw-ring-opacity));
}
}
@media (min-width: 1024px) {
.lg\:mx-10 {
margin-left: 2.5rem;
margin-right: 2.5rem;
}
.lg\:mx-3 {
margin-left: 0.75rem;
margin-right: 0.75rem;
@ -1307,10 +862,6 @@ Ensure the default browser behavior of the `hidden` attribute.
height: 100vh;
}
.lg\:w-1\/4 {
width: 25%;
}
.lg\:w-72 {
width: 18rem;
}
@ -1323,20 +874,8 @@ Ensure the default browser behavior of the `hidden` attribute.
overflow-y: hidden;
}
.lg\:overflow-y-scroll {
overflow-y: scroll;
}
.lg\:px-24 {
padding-left: 6rem;
padding-right: 6rem;
}
.scrollbar.lg\:overflow-y-hidden {
overflow-y: hidden;
}
.scrollbar-thin.lg\:overflow-y-hidden {
overflow-y: hidden;
}
}

12
routes/message.js Normal file
View File

@ -0,0 +1,12 @@
var express = require('express');
const db = require('../models');
var router = express.Router();
var Message = db.Message;
/* GET users listing. */
router.get('/', async function(req, res, next) {
var messages = await Message.findAll();
res.send(messages);
});
module.exports = router;

View File

@ -9,11 +9,21 @@ router.get('/', async function(req, res, next) {
res.send(users);
});
router.put('/:id', async function(req, res, next) {
router.get('/get/:id', async function(req, res, next) {
var users = await User.findByPk (req.params.id);
res.send(users);
});
router.put('/update/:id', async function(req, res, next) {
var users = await User.update({'email':'eve@uplink.si'}, {where:{'ID':req.params.id}});
res.send(users);
});
router.get('/new', async function(req, res, next) {
var users = await User.create({'name':'EVE2', 'email':'eve@2uplink.si', 'password':'some-random-password'});
res.send(users);
});
router.get('/add', function(req, res, next) {
res.send('respond with a resource');
});