Saturday, 22 April 2017

How to manage passport.js failures without redirect (return boolean instead)

I've been building an MEAN stack project using Angular-cli and the ng build function is super easy, but it doesn't compile an add anything in my server folder.

src
 |-app ...
 |-environments ...
 |-assets ...
 |- (all "./" files like "index.html" and "main.ts")
 |-server
   |-server.ts
   |-config.ts
   |-api
   |-models

I took at look at the minimal angular-cli.json ducmentation, but I haven't been able to figure out how to add my server Node app. I tried adding another app like this:

  "apps": [
    {
      "root": "src",
      // ... other default app config
      "environments": {
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      }
    },
    { // my new app
      "root": "src/server",
      "outDir": "dist-server",
      "main": "server.ts"
    }
  ]

but my the additional app isn't added.

Am I not sure if I am thinking about this the correct way. I see 1 of three options:

  1. I need to set up a distinct pipeline for my server outside of the the angular-cli setup. If so, where can I see some examples involving a tsc pipeline?
  2. Add the server to the current app within my angula-cli.json. If so, what configuration do I need to add.
  3. My attempt to create a new "app" is the correct approach, just incorrectly configured.


via Nate May

No comments:

Post a Comment