Toggle navigation
Toggle navigation
This project
Loading...
Sign in
송용우
/
oss-Jaksimsamil
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
송용우
2020-06-03 20:53:37 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
f07ae691336a24734e290f8fca4ec8e55e59c4a4
f07ae691
2 parents
874a0233
ac5aa59c
Merge commit '
ac5aa59c
' into feature/rest_api
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
2 deletions
jaksimsamil-server/.env
jaksimsamil-server/index.js
jaksimsamil-server/package.json
jaksimsamil-server/yarn.lock
jaksimsamil-server/.env
View file @
f07ae69
SERVER_PORT=4000
MONGO_URL=mongodb://localhost:27017/jaksimsamil
\ No newline at end of file
...
...
jaksimsamil-server/index.js
View file @
f07ae69
const
express
=
require
(
"express"
);
const
morgan
=
require
(
"morgan"
);
const
mongoose
=
require
(
"mongoose"
);
const
app
=
express
();
require
(
"dotenv"
).
config
();
const
{
SERVER_PORT
,
MONGO_URL
}
=
process
.
env
;
app
.
use
(
morgan
(
"[:date[iso]] :method :status :url :response-time(ms) :user-agent"
)
);
...
...
@@ -10,6 +11,14 @@ app.use(express.json());
app
.
use
(
express
.
urlencoded
({
extended
:
false
}));
app
.
use
(
"/api"
,
require
(
"./api"
));
app
.
listen
(
process
.
env
.
SERVER_PORT
,
()
=>
{
mongoose
.
connect
(
MONGO_URL
,
{
useNewUrlParser
:
true
,
useFindAndModify
:
false
})
.
then
(()
=>
{
console
.
log
(
"Connected to MongoDB"
);
})
.
catch
((
e
)
=>
{
console
.
log
(
e
);
});
app
.
listen
(
SERVER_PORT
,
()
=>
{
console
.
log
(
"Server is running on port"
,
process
.
env
.
SERVER_PORT
);
});
...
...
jaksimsamil-server/package.json
View file @
f07ae69
...
...
@@ -4,9 +4,11 @@
"main"
:
"index.js"
,
"license"
:
"MIT"
,
"dependencies"
:
{
"dotenv"
:
"^8.2.0"
,
"eslint-config-prettier"
:
"^6.11.0"
,
"express"
:
"^4.17.1"
,
"fs"
:
"^0.0.1-security"
,
"mongoose"
:
"^5.9.17"
,
"morgan"
:
"^1.10.0"
,
"path"
:
"^0.12.7"
},
...
...
jaksimsamil-server/yarn.lock
View file @
f07ae69
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment