Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
Today KU
Commits
fb983a82
Commit
fb983a82
authored
Nov 06, 2021
by
Yoon, Daeki
😅
Browse files
server root path
parent
d604ed75
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/app.js
View file @
fb983a82
import
express
from
'
express
'
import
express
from
"
express
"
;
import
cookieParser
from
'
cookie-parser
'
import
path
from
"
path
"
;
import
mainRouter
from
'
./routes/index.js
'
import
cookieParser
from
"
cookie-parser
"
;
import
mainRouter
from
"
./routes/index.js
"
;
const
app
=
express
()
// 배포용?
const
isProduction
=
process
.
env
.
NODE_ENV
===
"
production
"
;
let
root_url
=
"
/
"
;
if
(
isProduction
)
{
root_url
=
"
/app/todayku
"
;
}
const
CURRENT_WORKING_DIR
=
process
.
cwd
();
app
.
use
(
express
.
json
())
const
app
=
express
();
app
.
use
(
express
.
urlencoded
({
extended
:
true
}))
app
.
use
(
cookieParser
())
app
.
use
(
'
/api
'
,
mainRouter
)
export
default
app
app
.
use
(
\ No newline at end of file
path
.
join
(
root_url
,
"
/
"
),
express
.
static
(
path
.
join
(
CURRENT_WORKING_DIR
,
"
client
"
,
"
build
"
))
);
app
.
use
(
express
.
json
());
app
.
use
(
express
.
urlencoded
({
extended
:
true
}));
app
.
use
(
cookieParser
());
app
.
use
(
path
.
join
(
root_url
,
"
/api
"
),
mainRouter
);
export
default
app
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment