{"bugs":{"url":"https://github.com/angular/universal/issues"},"dist":{"shasum":"fc5aabcf71e0a86c96463097ae2d290420b26e24","tarball":"https://registry.npmjs.org/@nguniversal/express-engine/-/express-engine-16.0.0.tgz","fileCount":36,"integrity":"sha512-7e+7StsJMQRtxqcYYKmOm3PsX2hltKUfPq4OGuYeHojblPUfOQpkv/eM9ly1aCiuhr8OEKrsMWUmzN2RjHKEdg==","signatures":[{"sig":"MEUCIQCPUUoGzUAgQ+njgj00f1hCKf4FTASnHlKwtOlFQWov3gIgG+QD9uKZYBJkuFG8aFvfUPi8gAmc6airK5guon2V0A0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUqUvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZ2A/8CB44XjWrUdaoCKq9PC9007dfdcUTiwo0hpBiUcSwnIiBStQu\r\nbP8Q3mCeyfN6y+CWTnxz+gNoru42skqVFtLiSiOuI2Vwx06k1ZHS8r2l1qF9\r\nXTmZ34EJU+lrukFo4AnnloDryI4duORVz0MDp8wwTiU8dFZQZiraQsKbT4QW\r\nd1dq0BQ4GUf/RUmiehmVW4rmrF3enCCd9OUyd/+aGLI1uCrwmNCKPsKm9r5l\r\nKuEALKaa2pXCXar1LxXAO7ME1CC9FbS0/Sj7DC6AzorlQ8zCJr3bsUCElPhT\r\nNoe3QsMgkQNuMqgdPOl0XVoGn5fn2udFc3OfXPAiyMqbYDprxv/sEXVqEgo6\r\nXmHNFrv/tl8hUsyMiMpht3Y2cFVb7segyLm24FeaaLIS6UZKYP2r7VuEvwTM\r\naT+PIFLWwIzLbACiJ9kqcQl7eXMjW8Ht6KswkTXDYWeHCGCc933W3B3pYk2V\r\nvjSQ1RSPNkiqn6V9miu8pisamSMhXpZwDGXgLbB6hTwKA+7f5fb9C43z94Jw\r\nmxzpQNs7l8iBwhFwTjXJOoWUthd1gaCs2aWb/GtssIGpBRPF/vYbv8xYRId5\r\nHXrxfU0LwcO+6BUh+xUyvE7haw8z6CVgq8v4FUxbZuwfcc/ouAr2fXWVVkrZ\r\nXM1h4D/Aw5P6OvE8g7Alw5K0t4MwUZzt09c=\r\n=WWA+\r\n-----END PGP SIGNATURE-----\r\n"},"name":"@nguniversal/express-engine","type":"module","module":"./fesm2022/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":"^16.14.0 || >=18.10.0"},"exports":{".":{"esm":"./esm2022/express-engine.mjs","types":"./index.d.ts","default":"./fesm2022/express-engine.mjs","esm2022":"./esm2022/express-engine.mjs"},"./tokens":{"esm":"./esm2022/tokens/tokens.mjs","types":"./tokens/index.d.ts","default":"./fesm2022/tokens.mjs","esm2022":"./esm2022/tokens/tokens.mjs"},"./package.json":{"default":"./package.json"}},"gitHead":"b644d8afa2a774bcf6a4cae718e3a25115a3ec91","license":"MIT","typings":"./index.d.ts","_npmUser":{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},"homepage":"https://github.com/angular/universal","keywords":["express","ssr","universal"],"ng-update":{"packageGroup":["@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.3.1","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.14.0","dependencies":{"tslib":"^2.3.0","@nguniversal/common":"16.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","peerDependencies":{"express":"^4.15.2","@angular/core":"^16.0.0 || ^16.0.0-next.0","@angular/common":"^16.0.0 || ^16.0.0-next.0"},"_npmOperationalInternal":{"tmp":"tmp/express-engine_16.0.0_1683137839493_0.15642742104025986","host":"s3://npm-registry-packages"},"_id":"@nguniversal/express-engine@16.0.0","version":"16.0.0"}