FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
angular2-app/server.js at master · springboot-angular2-tutorial/angular2-app · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
springboot-angular2-tutorial
/
angular2-app
Public
Notifications
You must be signed in to change notification settings
Fork
46
Star
141
Code
Issues
1
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
angular2-app
/
server.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (18 loc) · 531 Bytes
Breadcrumbs
angular2-app
/
server.js
Copy path
File metadata and controls
22 lines (18 loc) · 531 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const
express
=
require
(
'express'
)
;
const
app
=
express
(
)
;
const
httpProxy
=
require
(
'http-proxy'
)
;
const
apiProxy
=
httpProxy
.
createProxyServer
(
)
;
// serve static contents
app
.
use
(
express
.
static
(
'dist'
)
)
;
// proxy api request
app
.
all
(
"/api/*"
,
(
req
,
res
)
=>
{
apiProxy
.
web
(
req
,
res
,
{
target
:
'http://localhost:8080'
}
)
;
}
)
;
// fallback to index.html for SPA.
app
.
get
(
'*'
,
(
req
,
res
)
=>
{
res
.
sendFile
(
__dirname
+
'/dist/index.html'
)
;
}
)
;
app
.
listen
(
4200
)
;
console
.
log
(
"server is running on http://localhost:4200"
)
;
Back
|
FazBrowse Home
|
New Git URL