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:48:45 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2a3979dff015698a57118abe7c2d1de1d0924ac4
2a3979df
1 parent
7ec4b1a2
Init MongoDB
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 @
2a3979d
SERVER_PORT=4000
MONGO_URL=mongodb://localhost:27017/jaksimsamil
\ No newline at end of file
...
...
jaksimsamil-server/index.js
View file @
2a3979d
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 @
2a3979d
...
...
@@ -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 @
2a3979d
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment