Toggle navigation
Toggle navigation
This project
Loading...
Sign in
MotherProject
/
Jaksimsamil
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
송용우
2020-06-03 20:49:31 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
ac5aa59cb4dd56307e7d13d1d06b8a7419f213e7
ac5aa59c
2 parents
7ec4b1a2
2a3979df
Merge branch 'feature/database' into develop
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 @
ac5aa59
SERVER_PORT=4000
MONGO_URL=mongodb://localhost:27017/jaksimsamil
\ No newline at end of file
...
...
jaksimsamil-server/index.js
View file @
ac5aa59
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 @
ac5aa59
...
...
@@ -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 @
ac5aa59
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment