DavideViolante/Angular-Full-Stack

On production response return html instead json resp

skaka34 opened this issue · 0 comments

I upload my project server. But I am facing problem is when I go for login page and click on login button give Invalid credential and when I checked in network response get like this
Response HTTP/1.1 200 OK ETag: "848-570a786390bf1-gzip" **Content-Type: text/html** Date: Tue, 10 Jul 2018 16:47:31 GMT Last-Modified: Tue, 10 Jul 2018 16:21:37 GMT Server: Apache/2.4.18 (Ubuntu) Content-Length: 733 Connection: Keep-Alive Accept-Ranges: bytes Keep-Alive: timeout=5, max=100 Content-Encoding: gzip Vary: Accept-Encoding
I don't know what wrong I followed this steps

Return repsonse Content-Type: text/html instead of json

  1. Edit package.json as following:
    add this line to scripts: "postinstall": "tsc -p server && ng build -aot -prod"
    move the following packages from devDependencies to dependencies: @angular/cli, @angular/compiler-cli, @types/jasmine, @types/node, chai, chai-http and typescript.
  2. then run this command ng build --prod

Please suggest me how to solve this issue. Thanks.