{"bugs":{"url":"https://github.com/angular/universal/issues"},"dist":{"shasum":"98f7119ea4b8f5a7b8566e566ab1f621a1f82060","tarball":"https://registry.npmjs.org/@nguniversal/express-engine/-/express-engine-8.0.0-beta.0.tgz","fileCount":70,"integrity":"sha512-JgjmStgz+9Dm/TipMbIiW8sUBP7C6ZuSKtV3Z73f8AtXHkRmHP59U7+TsQtdKxawYBkU15q4ogM1o0FyY3kvuw==","signatures":[{"sig":"MEQCIBihTjyctahCerfwk/0fFTVW+1tRiCsfCTVbxvEzXANpAiAhECutvV5Ok9FkK4oxGdLZ2MdzMJkp/qXjIpHqDMKIEg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":178565,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcwox0CRA9TVsSAnZWagAAj5kP/Az57aRYBikIWUVJTVHx\nRSZFB6ytGCx5eslcZf0X0LQCp4r8camtcjMTQ7AV6/0W4QfwJLabU6ex3vmX\ncRqD63dUb1O83udOlTTAY6SdxYANKksXHvGlAelNiFRQTmvofTjK42KQkMHX\nn5AKydAfhdmekuydRmtexSZ8sDJSqbdDpKjQ/SebnjK9z5u5ZbLtkaEa9NDj\ngac6rLTv6+7dzRmgjO6e5JR6G63VHGBN09oOuqVIau1NHKl+48EKg0fhEnF+\ncEfKF/ORyenW5BBGey1S8c5Qj4+vtFrxMM/raO+BuTl6KjQ8dpdSJeIoG89+\nDgehAgbl68VuAkly3GXjCr49JtPn8GUHncXGW3axOa/sNCpMqfBFYJRoaVre\nf+ouPRPhd3L6FySZfomPSxAxhRVn4pyO5POYnprUPCuU/nC9zVvTKaessJ3X\nUfBDzkg6/bSN3r6amjj6simZnoXIFsnvKjtQy7FtnB37ZRlv9eN2e0Y/YQGA\nQedvwp3WUJzFwaDQeNbYJVoU/tu/Oer+XkkZAxeOSXKLvQWYfi7vRHCN/LO3\nY/JMgLzQWwcbvPdyJOqcOzF5hihlI2knpAhoclUITtAZYpANPobW4/+Yy+eh\nRrwM6P6KSwQRSmqxXpiMAXDKtuz52iI4NbtyHPS20d1/ZB9Sv1Fb2pA3kxTo\ny1WC\r\n=WHr8\r\n-----END PGP SIGNATURE-----\r\n"},"esm5":"./esm5/express-engine_public_index.js","main":"./bundles/express-engine.umd.js","name":"@nguniversal/express-engine","fesm5":"./fesm5/express-engine.js","es2015":"./fesm2015/express-engine.js","module":"./fesm5/express-engine.js","readme":"# Angular Express Engine\n\nThis is an Express Engine for running Angular Apps on the server for server side rendering.\n\n## Usage\n\n`npm install @nguniversal/express-engine --save`\n\nTo use it, set the engine and then route requests to it\n\n```ts\nimport * as express from 'express';\nimport { ngExpressEngine } from '@nguniversal/express-engine';\n\n// Set the engine\napp.engine('html', ngExpressEngine({\n  bootstrap: ServerAppModule // Give it a module to bootstrap\n}));\n\napp.set('view engine', 'html');\n\napp.get('/**/*', (req: Request, res: Response) => {\n  res.render('../dist/index', {\n    req,\n    res\n  });\n});\n```\n\n## Configuring the URL and Document\n\nIt is possible to override the default URL and document fetched when the rendering engine\nis called. To do so, simply pass in a `url` and/or `document` string to the renderer as follows:\n\n```ts\napp.get('/**/*', (req: Request, res: Response) => {\n  let url = 'http://someurl.com';\n  let doc = '<html><head><title>New doc</title></head></html>';\n  res.render('../dist/index', {\n    req,\n    res,\n    url,\n    document: doc\n  });\n});\n```\n\n## Extra Providers\n\nExtra Providers can be provided either on engine setup\n\n```ts\napp.engine('html', ngExpressEngine({\n  bootstrap: ServerAppModule,\n  providers: [\n    ServerService\n  ]\n}));\n```\n\n## Advanced Usage\n\n### Request based Bootstrap\n\nThe Bootstrap module as well as more providers can be passed on request\n\n```ts\napp.get('/**/*', (req: Request, res: Response) => {\n  res.render('../dist/index', {\n    req,\n    res,\n    bootstrap: OtherServerAppModule,\n    providers: [\n      OtherServerService\n    ]\n  });\n});\n```\n\n### Using the Request and Response\n\nThe Request and Response objects are injected into the app via injection tokens.\nYou can access them by @Inject\n\n```ts\nimport { Request } from 'express';\nimport { REQUEST } from '@nguniversal/express-engine/tokens';\n\n@Injectable()\nexport class RequestService {\n  constructor(@Inject(REQUEST) private request: Request) {}\n}\n```\n\nIf your app runs on the client side too, you will have to provide your own versions of these in the client app.\n\n### Using a Custom Callback\n\nYou can also use a custom callback to better handle your errors\n\n```ts\napp.get('/**/*', (req: Request, res: Response) => {\n  res.render('../dist/index', {\n    req,\n    res\n  }, (err: Error, html: string) => {\n    res.status(html ? 200 : 500).send(html || err.message);\n  });\n});\n```\n","esm2015":"./esm2015/express-engine_public_index.js","license":"MIT","typings":"./express-engine_public_index.d.ts","_npmUser":{"name":"nguniversal","email":"viks@google.com"},"fesm2015":"./fesm2015/express-engine.js","homepage":"https://github.com/angular/universal","keywords":["express","ssr","universal"],"ng-update":{"packageGroup":["@nguniversal/aspnetcore-engine","@nguniversal/common","@nguniversal/express-engine","@nguniversal/hapi-engine","@nguniversal/module-map-ngfactory-loader"]},"repository":{"url":"git+https://github.com/angular/universal.git","type":"git"},"schematics":"./schematics/collection.json","_npmVersion":"6.4.1","description":"Express Engine for running Server Angular Apps","directories":{},"maintainers":[{"name":"nguniversal","email":"viks@google.com"}],"_nodeVersion":"10.15.3","_hasShrinkwrap":false,"readmeFilename":"README.md","peerDependencies":{"express":"^4.15.2","@angular/core":"^8.0.0-beta.14","@angular/common":"^8.0.0-beta.14","@angular/platform-server":"^8.0.0-beta.14"},"_npmOperationalInternal":{"tmp":"tmp/express-engine_8.0.0-beta.0_1556253811495_0.20593063143222","host":"s3://npm-registry-packages"},"_id":"@nguniversal/express-engine@8.0.0-beta.0","version":"8.0.0-beta.0"}