Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
firtanaelif committed Dec 13, 2020
1 parent ad5a217 commit faae632
Show file tree
Hide file tree
Showing 30 changed files with 1,628 additions and 1,119 deletions.
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 28 additions & 2 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import dotenv from 'dotenv';
dotenv.config();

export default {
PORT: process.env.PORT || 5000,
MONGODB_URL: process.env.MONGODB_URL,
JWT_SECRET: process.env.JWT_SECRET
};
2 changes: 0 additions & 2 deletions backend/models/userModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@ const userSchema = new mongoose.Schema({
password: { type: String, required: true },
isAdmin: { type: Boolean, required: true, default: false },
});

const User = mongoose.model('User', userSchema);

export default User;
7 changes: 3 additions & 4 deletions backend/routers/userRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ userRouter.get(
expressAsyncHandler(async (req, res) => {
try {
const user = new User({
name: 'elif',
email: 'firtana.elif@gmail.com',
password: 'elif12345',
name: 'admin',
email: 'admin@example.com',
password: '123456',
isAdmin: true,
});
const createdUser = await user.save();
Expand Down Expand Up @@ -45,4 +45,3 @@ userRouter.post(
})
);
export default userRouter;

4 changes: 2 additions & 2 deletions backend/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import express from 'express';
import cors from 'cors';
import mongoose from 'mongoose';
import bodyParser from 'body-parser';
import data from './data';
import config from './config';
import userRouter from './routers/userRouter';
import data from './data';
mongoose
.connect(config.MONGODB_URL, {
useNewUrlParser: true,
Expand Down Expand Up @@ -36,6 +36,6 @@ app.use((err, req, res, next) => {
const status = err.name && err.name === 'ValidationError' ? 400 : 500;
res.status(status).send({ message: err.message });
});
app.listen(5000, () => {
app.listen(config.PORT, () => {
console.log('serve at http://localhost:5000');
});
20 changes: 10 additions & 10 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link href="style.css" rel="stylesheet">
<title>/// QR-MENU</title>
<script src="src/index.js" type="module"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/chartist.js/latest/chartist.min.css"
/>
<link rel="stylesheet" href="style.css" />
<title>QR CODE</title>
</head>

<body>
<div class="grid-container">
<header id="header-container"></header>
<main id="main-container"></main>
<footer>
All right reserved by @firtanaelif
All rights reserved @firtanaelif
</footer>
</div>
<script src="main.js" type="module"></script>
<script src="main.js"></script>
</body>

</html>
4 changes: 2 additions & 2 deletions frontend/node_modules/.yarn-integrity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions frontend/node_modules/express-async-handler/.travis.yml

This file was deleted.

28 changes: 0 additions & 28 deletions frontend/node_modules/express-async-handler/README.md

This file was deleted.

8 changes: 0 additions & 8 deletions frontend/node_modules/express-async-handler/index.d.ts

This file was deleted.

8 changes: 0 additions & 8 deletions frontend/node_modules/express-async-handler/index.js

This file was deleted.

30 changes: 0 additions & 30 deletions frontend/node_modules/express-async-handler/package.json

This file was deleted.

100 changes: 0 additions & 100 deletions frontend/node_modules/express-async-handler/test.js

This file was deleted.

Loading

0 comments on commit faae632

Please sign in to comment.