Commit c9ce69ad authored by Kim, Subin's avatar Kim, Subin
Browse files

ㅁㅁ

parent 110583e7
...@@ -4,6 +4,7 @@ const path = require('path'); ...@@ -4,6 +4,7 @@ const path = require('path');
const cookieParser = require('cookie-parser'); const cookieParser = require('cookie-parser');
const logger = require('morgan'); const logger = require('morgan');
const port = 3030; const port = 3030;
require('dotenv').config();
const indexRouter = require('./routes/index'); const indexRouter = require('./routes/index');
const usersRouter = require('./routes/users'); const usersRouter = require('./routes/users');
...@@ -19,7 +20,7 @@ connect(); ...@@ -19,7 +20,7 @@ connect();
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);
...@@ -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;
\ No newline at end of file
This diff is collapsed.
...@@ -9,6 +9,8 @@ ...@@ -9,6 +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",
"jquery": "^3.5.1",
"popper.js": "^1.16.1",
"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",
...@@ -22,7 +24,6 @@ ...@@ -22,7 +24,6 @@
"test": "react-scripts test", "test": "react-scripts test",
"eject": "react-scripts eject" "eject": "react-scripts eject"
}, },
"proxy": "http://localhost:3030",
"eslintConfig": { "eslintConfig": {
"extends": "react-app" "extends": "react-app"
}, },
...@@ -37,5 +38,6 @@ ...@@ -37,5 +38,6 @@
"last 1 firefox version", "last 1 firefox version",
"last 1 safari version" "last 1 safari version"
] ]
} },
"proxy": "http://localhost:3030"
} }
\ No newline at end of file
import React, { } from 'react';
import styled from 'styled-components';
import { Link } from 'react-router-dom';
const Log = styled.div`
background-color: #981e1e;
`
const Logo = styled.div`
background-color: #E76A6A;
`
function Login() {
return (
<div className="container-fluid">
<div className="row">
<Logo className="col-md-5 col-12">
<h2>고려대학교</h2>
<h4>대관 시스템</h4>
</Logo>
<Log className="col-md-7 col-12">
<form encType='multipart/form-data' className="mt-4" style={{ height: "100%" }}>
<div className="form-group">
<label for="title_input">학번</label>
<input className="form-control" id="title_input" name="title" type="text" required />
</div>
<div className="form-group">
<label for="author_input">비밀번호</label>
<input className="form-control" id="author_input" name="author" type="text" required />
</div>
<div className="form-group">
<Link to="/home">
<button className="btn" type="submit">로그인</button>
</Link>
</div>
</form>
</Log>
</div>
</div>
)
}
export default Login
\ 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 { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom'; import { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom';
import App from './App';
import * as serviceWorker from './serviceWorker'; import * as serviceWorker from './serviceWorker';
import 'bootstrap'; import 'bootstrap';
import 'bootstrap/dist/css/bootstrap.css'; import 'bootstrap/dist/css/bootstrap.css';
// import Login from './Pages/Login';
// import Home from './Pages/Home';
import App from './App'
ReactDOM.render( ReactDOM.render(
<React.StrictMode> <App />,
<App />
</React.StrictMode>,
document.getElementById('root') document.getElementById('root')
); );
// ReactDOM.render(
// <Router>
// <Switch>
// <Route exact path="/" component={Login} />
// <Route path="/home" component={Home} />
// </Switch>
// </Router>,
// document.getElementById('root')
// );
// If you want your app to work offline and load faster, you can change // If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls. // unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA // Learn more about service workers: https://bit.ly/CRA-PWA
......
This diff is collapsed.
const mongoose = require('mongoose'); const mongoose = require('mongoose');
const { Schema } = mongoose; const { Schema } = mongoose;
const reserveSchema = new Schema({}); const reserveSchema = new Schema({
date: {
type: String,
},
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); module.exports = mongoose.model('Reserve', reserveSchema);
\ No newline at end of file
...@@ -2,7 +2,16 @@ const mongoose = require('mongoose'); ...@@ -2,7 +2,16 @@ const mongoose = require('mongoose');
const { Schema } = mongoose; const { Schema } = mongoose;
const userSchema = new Schema({ const userSchema = new Schema({
id : {
type: Number,
unique: true,
},
password : {
type: String,
},
name : {
type: String,
}
}); });
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