What I have to config to access an Angular2 app from a remote server without a port number. For example: My server where wakanda is running is www.myserver.com and my Angular2 app is reachable via localhost:8000. Now I'll use something like www.myserver.com/myapp/ to see my Angular2 app. I've found the webpack.config.js, but no idea whether this is the right place to do it or what config to set.
Asked
Active
Viewed 2,715 times
3 Answers
0
Check your protractor.conf.js file. In this file change your baseUrl.
baseUrl: 'your base url',

Harleen Kaur Arora
- 1,949
- 2
- 23
- 55
0
No idea about what wakanda is, but only point you have to mind is your baseUrl, which for your localhost seems to be "/" and you want it to be "/myapp" in production.
You'll need to set it up in index.html inside the head tag like this:
<head>
<base href="/myapp">
...
</head>
And in webpack config
output: {
publicPath: '/myapp',
...
},

Ignasi
- 732
- 4
- 23
0
Public URLs by default map to port 80. You can specify ng serve --port 80
in your package.json
file in your Angular2 directory so that the application is accessible without specifying port.