Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
RIT_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박권수
2021-08-17 02:34:24 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0656adb94cf48ab93e63937424bb829ca8b74e5d
0656adb9
1 parent
41cea7f3
feat. cors
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
0 deletions
server/index.js
server/package.json
server/yarn.lock
server/index.js
View file @
0656adb
const
Koa
=
require
(
'koa'
);
const
cors
=
require
(
'@koa/cors'
);
const
Router
=
require
(
'koa-router'
);
const
bodyparser
=
require
(
'koa-bodyparser'
);
...
...
@@ -29,6 +30,7 @@ Mongoose.connect(MONGO_URL, {
app
.
use
(
bodyparser
());
router
.
use
(
'/api'
,
api
.
routes
());
app
.
use
(
cors
());
app
.
use
(
router
.
routes
()).
use
(
router
.
allowedMethods
());
app
.
listen
(
SERVER_PORT
,
()
=>
{
...
...
server/package.json
View file @
0656adb
...
...
@@ -17,6 +17,7 @@
"author"
:
"박권수"
,
"license"
:
"ISC"
,
"dependencies"
:
{
"@koa/cors"
:
"^3.1.0"
,
"moment"
:
"^2.29.1"
,
"mqtt"
:
"^4.2.6"
},
...
...
server/yarn.lock
View file @
0656adb
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment