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');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
// const createError = require('http-errors');
const express = require('express');
const path = require('path');
const cookieParser = require('cookie-parser');
const logger = require('morgan');
const port = 3030;
require('dotenv').config();
const indexRouter = require('./routes/index');
const usersRouter = require('./routes/users');
const connect = require('./schemas');
var app = express();
const app = express();
connect();
const port = 3030;
app.listen(port, () => console.log(port));
// view engine setup
// app.set('views', path.join(__dirname, 'views'));
// app.set('view engine', 'pug');
......@@ -21,12 +20,14 @@ app.listen(port, () => console.log(port));
app.use(logger('dev'));
app.use(express.json());
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('/', indexRouter);
app.use('/users', usersRouter);
app.listen(port, () => console.log(port));
// catch 404 and forward to error handler
app.use(function(req, res, next) {
next(createError(404));
......@@ -40,7 +41,7 @@ app.use(function(err, req, res, next) {
// render the error page
res.status(err.status || 500);
res.render('error');
// res.render('error');
});
module.exports = app;
......@@ -67,6 +67,13 @@
"@babel/types": "^7.11.5",
"jsesc": "^2.5.1",
"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": {
......
......@@ -9,11 +9,8 @@
"axios": "^0.20.0",
"bootstrap": "^4.5.2",
"formik": "^2.1.5",
<<<<<<< HEAD
"jquery": "^3.5.1",
"popper.js": "^1.16.1",
=======
>>>>>>> origin/rkyoung7
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
......@@ -25,13 +22,9 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
<<<<<<< HEAD
"eject": "react-scripts eject",
"proxy": "http://localhost:3030"
=======
"eject": "react-scripts eject"
>>>>>>> origin/rkyoung7
},
"proxy": "http://localhost:3030",
"eslintConfig": {
"extends": "react-app"
},
......
......@@ -11,7 +11,6 @@ const Logo = styled.div`
background-color: #E76A6A;
`
function Login() {
return (
<div className="container-fluid">
......
......@@ -133,4 +133,4 @@ function Signup() {
}
export default Signup;
export default Signup;
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import * as serviceWorker from './serviceWorker';
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 Login from './Pages/LoginPage';
......
......@@ -20,9 +20,10 @@ module.exports = () => {
console.error('몽고디비 연결 에러', error);
});
mongoose.connection.on('disconnected', () => {
console.error('몽고디비 연결이 끊겼습니다. 연결을재시도합니다.');
console.error('몽고디비 연결이 끊겼습니다. 연결을 재시도합니다.');
connect();
});
require('./user');
require('./reserve');
};
\ No newline at end of file
};
......@@ -7,38 +7,28 @@ const reserveSchema = new Schema({
},
time: {
type: String,
},
room:{
type: String,
},
name: { //대표자 이름
type: String,
},
id:{
type: Number,
},
reason: {
type: String,
},
member: {
type: String,
},
approve: {
type: Boolean,
},
num: {
type: Number,
},
}
});
module.exports = mongoose.model('Reserve', reserveSchema);
......@@ -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