KingDarBoja / example-angular-ng-toolkit

Sample angular 8 app using latest ng-toolkit packages.
2 stars 2 forks source link

cannot execute npm run server #2

Open ghost opened 4 years ago

ghost commented 4 years ago

I can do npm run build:prod but I get this error:

npm ERR! missing script: server

when I npm run server.

so I can I run the ssr version?

KingDarBoja commented 4 years ago

You should run npm run serve:ssr after running npm run build:ssr or npm run build:prod.

ghost commented 4 years ago

ok, I did npm run serve:ssr, it says: Node Express server listening on http://localhost:4000

it looks ok, but the pages are not SSR.

KingDarBoja commented 4 years ago

it looks ok, but the pages are not SSR.

Are you sure about that? I have run lighthouse audit on the localhost page by using Chrome DevTools and pretty much it has almost 100% score on SSR. Same after being deployed on AWS.

ghost commented 4 years ago

well, I opened Chrome, I typed http://localhost:4000, displayed the page, right click, View Page Source and what is displayed it is the same as a normal angular running on web browser.

KingDarBoja commented 4 years ago

That's the idea, in order to truly test if ssr works is by using curl -i localhost:4000 and see if the resulting response is the same as the normal one.

Browser

Curl

ghost commented 4 years ago

ok, thanks.