Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
reservation-service
Commits
c9ce69ad
Commit
c9ce69ad
authored
Sep 18, 2020
by
Kim, Subin
Browse files
ㅁㅁ
parent
110583e7
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
server/app.js
View file @
c9ce69ad
...
...
@@ -4,6 +4,7 @@ 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
'
);
...
...
@@ -19,7 +20,7 @@ connect();
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
);
...
...
@@ -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
;
\ No newline at end of file
server/client/package-lock.json
View file @
c9ce69ad
This diff is collapsed.
Click to expand it.
server/client/package.json
View file @
c9ce69ad
...
...
@@ -9,6 +9,8 @@
"axios"
:
"^0.20.0"
,
"bootstrap"
:
"^4.5.2"
,
"formik"
:
"^2.1.5"
,
"jquery"
:
"^3.5.1"
,
"popper.js"
:
"^1.16.1"
,
"react"
:
"^16.13.1"
,
"react-dom"
:
"^16.13.1"
,
"react-router-dom"
:
"^5.2.0"
,
...
...
@@ -22,7 +24,6 @@
"test"
:
"react-scripts test"
,
"eject"
:
"react-scripts eject"
},
"proxy"
:
"http://localhost:3030"
,
"eslintConfig"
:
{
"extends"
:
"react-app"
},
...
...
@@ -37,5 +38,6 @@
"last 1 firefox version"
,
"last 1 safari version"
]
}
}
},
"proxy"
:
"http://localhost:3030"
}
\ No newline at end of file
server/client/src/Pages/Home.js
0 → 100644
View file @
c9ce69ad
server/client/src/Pages/Login.js
0 → 100644
View file @
c9ce69ad
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
server/client/src/index.js
View file @
c9ce69ad
import
React
from
'
react
'
;
import
ReactDOM
from
'
react-dom
'
;
import
{
BrowserRouter
as
Router
,
Route
,
Redirect
,
Switch
}
from
'
react-router-dom
'
;
import
App
from
'
./App
'
;
import
*
as
serviceWorker
from
'
./serviceWorker
'
;
import
'
bootstrap
'
;
import
'
bootstrap/dist/css/bootstrap.css
'
;
// import Login from './Pages/Login';
// import Home from './Pages/Home';
import
App
from
'
./App
'
ReactDOM
.
render
(
<
React
.
StrictMode
>
<
App
/>
<
/React.StrictMode>
,
<
App
/>
,
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
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
...
...
server/package-lock.json
View file @
c9ce69ad
This diff is collapsed.
Click to expand it.
server/schemas/reserve.js
View file @
c9ce69ad
const
mongoose
=
require
(
'
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
);
\ No newline at end of file
server/schemas/user.js
View file @
c9ce69ad
...
...
@@ -2,7 +2,16 @@ const mongoose = require('mongoose');
const
{
Schema
}
=
mongoose
;
const
userSchema
=
new
Schema
({
id
:
{
type
:
Number
,
unique
:
true
,
},
password
:
{
type
:
String
,
},
name
:
{
type
:
String
,
}
});
module
.
exports
=
mongoose
.
model
(
'
User
'
,
userSchema
);
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment