Commit 48925fcb authored by Lee Jin Ju's avatar Lee Jin Ju
Browse files

Merge remote-tracking branch 'origin/kimpen' into hijinju

parents b9687379 0e979e43
var createError = require('http-errors'); // const createError = require('http-errors');
var express = require('express'); const express = require('express');
var path = require('path'); const path = require('path');
var cookieParser = require('cookie-parser'); const cookieParser = require('cookie-parser');
var logger = require('morgan'); const logger = require('morgan');
const port = 3030;
var indexRouter = require('./routes/index'); require('dotenv').config();
var usersRouter = require('./routes/users');
const indexRouter = require('./routes/index');
const usersRouter = require('./routes/users');
const connect = require('./schemas'); const connect = require('./schemas');
var app = express(); const app = express();
connect(); connect();
const port = 3030;
app.listen(port, () => console.log(port));
// view engine setup // view engine setup
// app.set('views', path.join(__dirname, 'views')); // app.set('views', path.join(__dirname, 'views'));
// app.set('view engine', 'pug'); // app.set('view engine', 'pug');
...@@ -21,12 +20,14 @@ app.listen(port, () => console.log(port)); ...@@ -21,12 +20,14 @@ app.listen(port, () => console.log(port));
app.use(logger('dev')); app.use(logger('dev'));
app.use(express.json()); app.use(express.json());
app.use(express.urlencoded({ extended: false })); app.use(express.urlencoded({ extended: false }));
app.use(cookieParser()); app.use(cookieParser(process.env.JWT_SECRET));
app.use(express.static(path.join(__dirname, 'public'))); app.use(express.static(path.join(__dirname, 'public')));
app.use('/', indexRouter); app.use('/', indexRouter);
app.use('/users', usersRouter); app.use('/users', usersRouter);
app.listen(port, () => console.log(port));
// catch 404 and forward to error handler // catch 404 and forward to error handler
app.use(function(req, res, next) { app.use(function(req, res, next) {
next(createError(404)); next(createError(404));
...@@ -40,7 +41,7 @@ app.use(function(err, req, res, next) { ...@@ -40,7 +41,7 @@ app.use(function(err, req, res, next) {
// render the error page // render the error page
res.status(err.status || 500); res.status(err.status || 500);
res.render('error'); // res.render('error');
}); });
module.exports = app; module.exports = app;
...@@ -67,6 +67,13 @@ ...@@ -67,6 +67,13 @@
"@babel/types": "^7.11.5", "@babel/types": "^7.11.5",
"jsesc": "^2.5.1", "jsesc": "^2.5.1",
"source-map": "^0.5.0" "source-map": "^0.5.0"
},
"dependencies": {
"source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w="
}
} }
}, },
"@babel/helper-annotate-as-pure": { "@babel/helper-annotate-as-pure": {
......
...@@ -9,11 +9,8 @@ ...@@ -9,11 +9,8 @@
"axios": "^0.20.0", "axios": "^0.20.0",
"bootstrap": "^4.5.2", "bootstrap": "^4.5.2",
"formik": "^2.1.5", "formik": "^2.1.5",
<<<<<<< HEAD
"jquery": "^3.5.1", "jquery": "^3.5.1",
"popper.js": "^1.16.1", "popper.js": "^1.16.1",
=======
>>>>>>> origin/rkyoung7
"react": "^16.13.1", "react": "^16.13.1",
"react-dom": "^16.13.1", "react-dom": "^16.13.1",
"react-router-dom": "^5.2.0", "react-router-dom": "^5.2.0",
...@@ -25,13 +22,9 @@ ...@@ -25,13 +22,9 @@
"start": "react-scripts start", "start": "react-scripts start",
"build": "react-scripts build", "build": "react-scripts build",
"test": "react-scripts test", "test": "react-scripts test",
<<<<<<< HEAD
"eject": "react-scripts eject",
"proxy": "http://localhost:3030"
=======
"eject": "react-scripts eject" "eject": "react-scripts eject"
>>>>>>> origin/rkyoung7
}, },
"proxy": "http://localhost:3030",
"eslintConfig": { "eslintConfig": {
"extends": "react-app" "extends": "react-app"
}, },
......
...@@ -11,7 +11,6 @@ const Logo = styled.div` ...@@ -11,7 +11,6 @@ const Logo = styled.div`
background-color: #E76A6A; background-color: #E76A6A;
` `
function Login() { function Login() {
return ( return (
<div className="container-fluid"> <div className="container-fluid">
......
...@@ -133,4 +133,4 @@ function Signup() { ...@@ -133,4 +133,4 @@ function Signup() {
} }
export default Signup; export default Signup;
\ No newline at end of file
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import * as serviceWorker from './serviceWorker';
import { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom'; import { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom';
import * as serviceWorker from './serviceWorker';
import 'bootstrap';
import 'bootstrap/dist/css/bootstrap.css'; import 'bootstrap/dist/css/bootstrap.css';
import Login from './Pages/LoginPage'; import Login from './Pages/LoginPage';
......
...@@ -20,9 +20,10 @@ module.exports = () => { ...@@ -20,9 +20,10 @@ module.exports = () => {
console.error('몽고디비 연결 에러', error); console.error('몽고디비 연결 에러', error);
}); });
mongoose.connection.on('disconnected', () => { mongoose.connection.on('disconnected', () => {
console.error('몽고디비 연결이 끊겼습니다. 연결을재시도합니다.'); console.error('몽고디비 연결이 끊겼습니다. 연결을 재시도합니다.');
connect(); connect();
}); });
require('./user'); require('./user');
require('./reserve'); require('./reserve');
}; };
\ No newline at end of file
...@@ -7,38 +7,28 @@ const reserveSchema = new Schema({ ...@@ -7,38 +7,28 @@ const reserveSchema = new Schema({
}, },
time: { time: {
type: String, type: String,
}, },
room:{ room:{
type: String, type: String,
}, },
name: { //대표자 이름 name: { //대표자 이름
type: String, type: String,
}, },
id:{ id:{
type: Number, type: Number,
}, },
reason: { reason: {
type: String, type: String,
}, },
member: { member: {
type: String, type: String,
}, },
approve: { approve: {
type: Boolean, type: Boolean,
}, },
num: { num: {
type: Number, type: Number,
}
},
}); });
module.exports = mongoose.model('Reserve', reserveSchema); module.exports = mongoose.model('Reserve', reserveSchema);
...@@ -38,4 +38,4 @@ userSchema.pre("save", function (next) { ...@@ -38,4 +38,4 @@ userSchema.pre("save", function (next) {
}); });
module.exports = mongoose.model('User', userSchema); module.exports = mongoose.model('User', userSchema);
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment