born2net
born2net

Reputation: 24953

angular2 trying to host a cli project in a non root dir

I am trying to publish the project to a node server which resides in a path that is non root. this is the project: https://github.com/splintercode/ng-pokedex

In other words: https://secure.digitalsignage.com/poke/ (poke dir) as you cam see, I get no assets I did publish with:

ng build --target=production --base-href ./
ng build --target=production --base-href /poke
ng build --target=production --base-href /poke/
ng build --target=production --base-href ./poke

with no luck and you can clearly see the error in dev tools.

I was wondering if anyone has an idea on how to host in a non root node server dir.

Upvotes: 2

Views: 203

Answers (2)

born2net
born2net

Reputation: 24953

I was able to fix the issues by changing paths manually inside service-worker.js

Upvotes: 1

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657338

Set

<head>
  <base href="/poke">

or

@NgModule({
  providers: [{provide: APP_BASE_HREF, useValue: '/poke'}, ...],
  ...
})
export class AppModule() {}

Upvotes: 1

Related Questions