{"bugs":{"url":"https://github.com/angular/universal/issues"},"dist":{"shasum":"558de2a04568e13d8f0a0c3be625a352c1eaf2bf","tarball":"https://registry.npmjs.org/@nguniversal/express-engine/-/express-engine-14.1.0-next.2.tgz","fileCount":40,"integrity":"sha512-rKUUIv1wScESpPN3yOEU5XTBw/NZHE29YGr5qeZnhcoynpOeT9FGU4a0dNBhO2MohCFjWCTmveFEtCB0z2gJBQ==","signatures":[{"sig":"MEYCIQCeBFjG2wD1Gi+WZfAu8qG0kJ+AmEkc58KpER2DHcyLQQIhAO8DATaRuoRQReomLd6Vim8RM48L/MeU/s8fOfmzu4VJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":160359,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixaw/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrq6g/6A5NA5EIVAlTB1ERnyu/hnCOEd/fYnlZCiXys3TGW//4SbS7D\r\ngrNS5BTtglaiIymsFhb6Cc3CKDAbaT4OeDjaKfVoVVidlqCS5NxqWfcSgJes\r\ndcGPJP/5DVUcCorCm4elFbDKA0g7/HOvq5kiVy2LbDRUyMyzq/t3cQ2eO5ZD\r\nnWqYFGdXzZLDxLIS+6r1nJufhNBwltTUCduKLBjFOFpTlV8ahQkUT8DBfagv\r\ncrzxaK4VuOVMRcDyw675XC+E32yNaoP5LC3JAi6KYHvkOg2RhnTvnsfZjffI\r\nZ6CtF+Tr4WWTA4enivstfSetWGmtCb0UTZ1U6Eo6w+zp4HrLmenv79cWdBv3\r\nnTZWp0RKT0NW28v92cT7BAzOWf6q1wv/TH+3WwWhr9NiCI28j3P0J6PgxIFH\r\n6dx5ZQRm3OKru+bWuXVxKxjAtVcz+TqHzR9+7W6lfIiBbR8lBuetjMvzLloM\r\ns/gj9e6xPE8+BVA6G6RvONOVbOzRp74iE0Czb/2cvauDB5+aWWcs2g4D5X99\r\n1vWYNi+fJWBIFqqZ5azaPcVw0NqKPmvBITGVSvA6b0F4xfkjxDGdLYhsOaW+\r\nL2ruWun8Xh8Mhpv13GQZivNS7Q3m+sqwP1aJkV+Bq+LuwgIUkrkuEh/BRB1u\r\n2RcQmokUWGt8E7Mumg74wcT5t0IFQuuX0gM=\r\n=/d4u\r\n-----END PGP SIGNATURE-----\r\n"},"name":"@nguniversal/express-engine","type":"module","es2020":"./fesm2020/express-engine.mjs","module":"./fesm2015/express-engine.mjs","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 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":"^14.15.0 || >=16.10.0"},"esm2020":"./esm2020/express-engine.mjs","exports":{".":{"node":"./fesm2015/express-engine.mjs","types":"./index.d.ts","es2015":"./fesm2015/express-engine.mjs","es2020":"./fesm2020/express-engine.mjs","default":"./fesm2020/express-engine.mjs","esm2020":"./esm2020/express-engine.mjs"},"./tokens":{"node":"./fesm2015/tokens.mjs","types":"./tokens/index.d.ts","es2015":"./fesm2015/tokens.mjs","es2020":"./fesm2020/tokens.mjs","default":"./fesm2020/tokens.mjs","esm2020":"./esm2020/tokens/tokens.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"f07d966fb920f339970e0c91e725854f932bacec","license":"MIT","typings":"./index.d.ts","_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"fesm2015":"./fesm2015/express-engine.mjs","fesm2020":"./fesm2020/express-engine.mjs","homepage":"https://github.com/angular/universal","keywords":["express","ssr","universal"],"ng-update":{"packageGroup":["@nguniversal/aspnetcore-engine","@nguniversal/builders","@nguniversal/common","@nguniversal/express-engine"],"packageGroupName":"@nguniversal/express-engine"},"repository":{"url":"git+https://github.com/angular/universal.git","type":"git"},"schematics":"./schematics/collection.json","_npmVersion":"8.11.0","description":"Express Engine for running Server Angular Apps","directories":{},"maintainers":[{"name":"angular","email":"devops+npm@angular.io"},{"name":"google-wombot","email":"node-team-npm+wombot@google.com"}],"_nodeVersion":"16.15.1","dependencies":{"tslib":"^2.3.0","@nguniversal/common":"14.1.0-next.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","peerDependencies":{"express":"^4.15.2","@angular/core":"^14.1.0-next","@angular/common":"^14.1.0-next","@angular/platform-server":"^14.1.0-next"},"_npmOperationalInternal":{"tmp":"tmp/express-engine_14.1.0-next.2_1657121855033_0.7007319145530306","host":"s3://npm-registry-packages"},"_id":"@nguniversal/express-engine@14.1.0-next.2","version":"14.1.0-next.2"}