Toggle navigation
Toggle navigation
This project
Loading...
Sign in
고다경
/
Open_Source_project
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김태희
2019-06-05 22:00:15 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
782636a3f5ce110c001c5670732cfded02e0be32
782636a3
1 parent
986147ec
server.js 추가
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
server.js
server.js
0 → 100644
View file @
782636a
var
express
=
require
(
"express"
);
var
login
=
require
(
'./routes/loginroutes'
);
var
bodyParser
=
require
(
'body-parser'
);
var
app
=
express
();
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
true
})
);
app
.
use
(
bodyParser
.
json
()
);
app
.
use
(
function
(
req
,
res
,
next
)
{
res
.
header
(
"Access-Control-Allow-Origin"
,
"*"
);
res
.
header
(
"Access-Control-Allow-Headers"
,
"Origin, X-Requested-With, Content-Type, Accept"
);
next
();
});
var
router
=
express
.
Router
();
// test route
router
.
get
(
'/'
,
function
(
req
,
res
)
{
res
.
json
({
message
:
'welcome to our upload module apis'
});
});
// route to handle user registration
router
.
post
(
'/register'
,
login
.
register
);
router
.
post
(
'/login'
,
login
.
login
)
app
.
use
(
'/api'
,
router
);
app
.
listen
(
5000
);
Please
register
or
login
to post a comment