Toggle navigation
Toggle navigation
This project
Loading...
Sign in
윤창신
/
searchGuide
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
bluejoyq
2019-11-11 18:12:04 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f231d6ae2efac3b2d4e9d4a8ea1dcb245357b79a
f231d6ae
1 parent
9ce870fa
init backend structure
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
app.js
app.js
0 → 100644
View file @
f231d6a
const
express
=
require
(
'express'
);
const
app
=
express
();
const
bodyParser
=
require
(
'body-parser'
);
const
morgan
=
require
(
'morgan'
);
const
cors
=
require
(
'cors'
);
app
.
use
(
cors
(
)
);
app
.
use
(
morgan
(
'[:date[iso]] :method :status :url :response-time(ms) :user-agent'
));
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
true
}));
app
.
use
(
bodyParser
.
json
());
app
.
use
((
req
,
res
,
next
)
=>
{
res
.
header
(
"Access-Control-Allow-Origin"
,
"*"
);
res
.
header
(
"Access-Control-Allow-Headers"
,
"Origin, X-Requested-With, Content-Type, Accept"
);
next
();
});
app
.
use
(
'/api'
,
require
(
'./api'
)
);
app
.
listen
(
3000
,
(
)
=>
{
console
.
log
(
'Server On!'
);
});
\ No newline at end of file
Please
register
or
login
to post a comment