{"bugs":{"url":"https://github.com/angular/universal/issues"},"dist":{"shasum":"ab14dcc45e13a52c68107fccbdeb8eceeb2c61e7","tarball":"https://registry.npmjs.org/@nguniversal/express-engine/-/express-engine-0.0.0-PLACEHOLDER.tgz","fileCount":41,"integrity":"sha512-CB8Pyr+aQnZRy9AqVQ1FCiSWZy/bR6mwT3av4wqAQo79ot0dsx1pjFPaS0YqM1ZejCg3xPhzLkgBDCBMDBrPPw==","signatures":[{"sig":"MEUCIQDxaqPkWIMuWya4pgwzW78aTzGLmr2dGkvRDijpt0amEQIgORTGoT7jJq9HA3LHLGJsAUuaJHX+5SGFcu8qXWf29eQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":154559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkCmQCRA9TVsSAnZWagAAwfIP/1y9MENw6cgByzY4iqQ3\nMSbC6VFckABLJH2QkwNmRvt7QHxfvyqSVqYsYEMv8IA+C7m/SONkUT7Uibom\no7RXheePtPsu+ePdldOgbe6TAR/w/r+JuthguAdhCDInJ8+P0ncBDKma2xpm\njkaj0Gg8vl8jEaHyeV2mCj+a3S9yRISPE90fLaDTKS+opOfd8VftMy0h6UzB\n2CNk+2iNVf5KhaVkdZOelN7fmHwvXN+dBv9k2MdaRtT2Mt6mvBigKTKHGKM1\nhq2HEqwUj0NFio2t3NLimHq9YjpwoKjC4aDZRJqEsA/7O1ceJY0Erxq+g6iw\n1JKgktrg8qBmQ2ypPoFMZMkRKDkid0K36/EPTOaimYp8ok3hCu/T94jOSuur\nkv1th6HB0eo9kzWRcfO8BcuPkwrj18CMkN6AtaW6em8MvT8x8WGcs6I53daM\nPJAbObVCbHwSipKNTsiYDne063GE9L8zj7cIaBCGdHQgva6rOHm7PU0yNhCf\nEMfgaA8KxrgtVoD37s227GkvaUYboN/+pAXBpU1RAm4gv5/gWFmrAZOtkdfd\nJVNa8jtN0he6l1H3BdGYlPPZ+1fskyEOjX+lKzXM+YHwbEuHeendhH8sSBaq\nz/QkCzmQVaBECzq7OI5G9TABcqHHX587kJQd1rHspipyjvRQMu6qxJyCjJZJ\nHoC1\r\n=NObP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./bundles/express-engine.umd.js","name":"@nguniversal/express-engine","es2015":"./fesm2015/express-engine.js","module":"./fesm2015/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\nconst app = express();\n\n// Set the engine\napp.engine(\n  'html',\n  ngExpressEngine({\n    bootstrap: ServerAppModule, // Give it a module to bootstrap\n  }),\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(\n  'html',\n  ngExpressEngine({\n    bootstrap: ServerAppModule,\n    providers: [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: [OtherServerService],\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(\n    '../dist/index',\n    {\n      req,\n      res,\n    },\n    (err: Error, html: string) => {\n      res.status(html ? 200 : 500).send(html || err.message);\n    },\n  );\n});\n```\n","engines":{"node":">=12.13.0"},"esm2015":"./esm2015/express-engine.js","license":"MIT","typings":"./express-engine.d.ts","_npmUser":{"name":"angular","email":"devops+npm@angular.io"},"fesm2015":"./fesm2015/express-engine.js","homepage":"https://github.com/angular/universal","keywords":["express","ssr","universal"],"ng-update":{"migrations":"./schematics/migrations/migration-collection.json","packageGroup":["@nguniversal/aspnetcore-engine","@nguniversal/builders","@nguniversal/common","@nguniversal/express-engine","@nguniversal/hapi-engine"],"packageGroupName":"@nguniversal/express-engine"},"repository":{"url":"git+https://github.com/angular/universal.git","type":"git"},"schematics":"./schematics/collection.json","_npmVersion":"6.14.12","description":"Express Engine for running Server Angular Apps","directories":{},"maintainers":[{"name":"angular","email":"devops+npm@angular.io"},{"name":"nguniversal","email":"viks@google.com"},{"name":"google-wombot","email":"node-team-npm+wombot@google.com"}],"_nodeVersion":"14.16.1","dependencies":{"tslib":"^2.1.0","@nguniversal/common":"0.0.0-PLACEHOLDER"},"_hasShrinkwrap":false,"readmeFilename":"README.md","peerDependencies":{"express":"^4.15.2","@angular/core":"^12.0.0-rc.1","@angular/common":"^12.0.0-rc.1","@angular/platform-server":"^12.0.0-rc.1"},"_npmOperationalInternal":{"tmp":"tmp/express-engine_0.0.0-PLACEHOLDER_1620060560266_0.755460366965911","host":"s3://npm-registry-packages"},"_id":"@nguniversal/express-engine@0.0.0-PLACEHOLDER","version":"0.0.0-PLACEHOLDER"}