Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WIE_202021_CSBillero11
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bernard Roland (Student Com20)
WIE_202021_CSBillero11
Commits
4a49ae42
Commit
4a49ae42
authored
3 years ago
by
Bernard Roland (Student Com20)
Browse files
Options
Downloads
Patches
Plain Diff
index.html is now served as default for non-/api requests
parent
eb719bea
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
client/src/config.ts
+2
-2
2 additions, 2 deletions
client/src/config.ts
server/src/index.ts
+6
-2
6 additions, 2 deletions
server/src/index.ts
with
8 additions
and
4 deletions
client/src/config.ts
+
2
−
2
View file @
4a49ae42
export
let
apiRoot
:
string
;
if
(
process
.
env
.
NODE_ENV
===
'
production
'
)
{
apiRoot
=
`
${
window
.
location
.
origin
}
/v1`
;
apiRoot
=
`
${
window
.
location
.
origin
}
/
api/
v1`
;
}
else
{
apiRoot
=
`http://localhost:8000/v1`
;
apiRoot
=
`http://localhost:8000/
api/
v1`
;
}
This diff is collapsed.
Click to expand it.
server/src/index.ts
+
6
−
2
View file @
4a49ae42
...
...
@@ -9,11 +9,15 @@ migrate();
const
app
=
express
();
app
.
use
(
'
/api
'
,
api
);
if
(
web_serve
)
{
app
.
use
(
'
/
'
,
express
.
static
(
web_serve
));
}
app
.
use
(
api
);
app
.
get
(
'
/
'
,
(
_
,
res
)
=>
{
res
.
sendFile
(
'
index.html
'
,
{
root
:
web_serve
});
});
}
app
.
listen
(
port
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment