{"bugs":{"url":"https://github.com/angular/universal/issues"},"dist":{"shasum":"cc8d613b140858daff8d0e224d8b70b25618b35a","tarball":"https://registry.npmjs.org/@nguniversal/express-engine/-/express-engine-16.0.0-next.0.tgz","fileCount":40,"integrity":"sha512-tFC4Vq/oKW6UVOeNyHRH7koYwEaMM9FbMZAqhRwFkVzQPfixAlxxvkj/AiPpV6+CoHYUum5MLtNiVkhTIlh8uw==","signatures":[{"sig":"MEUCIC+aio/pk5mblqzKjdZNJFBW0fXxp4Q5Gs6Gdoh1gNHSAiEAvjTOUtrdo7fPH+pd+ypUx/pqR79ldfj9xg36/aSvyGc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":164769,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLVBRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZAg//SaSEktyVy3m07qW7Z/6N2FCHWK/YkJuukBVUP4VusVg10m5D\r\nFKaoo8vrJarMhF8+1qmSm/HF9y9sMVRpmnE0WN/w4O+pvAq2EjJPkxM3cVOF\r\nfZv5IQ1uh91CkC1mFG1rFVpdZ/3V07AA2MBpAfsvNrnNtD64W/twEO/8RqY6\r\nO/i60nKEhOMF7Xa8yZo8vlzJBu0wbJAeLUUfHBBxOvlBzIQSI9hDXaUUG03M\r\nMwISwvgv1PNgO81GzVNjv+rbUTxNjYFB7G/Ihu63r7lz92IbomfNUW7d7ToH\r\nitnxuqhUk/zEkUelabEdhzDNaqslqTi+uyTvn+OkvRzPpZTtS2hV/Rg14VoG\r\nx83fLqA6/RQDfJU94MrD1h6x1/M6PZb7DfwfhVkmujFo7xH8ZR+LIsA0Xxl2\r\nnrChZsVZT3CUDY5P0WJM5TQDarm8VGGcDjo5S/3fhSwN1UyYG8FGGKW5PYep\r\nzzbtDgz6hhWOa22ZaCxhMHRT+EMSDvNjC24qTNychnzVM+huYAGTqy3ZOAgt\r\nMJpp2JVsUCaPcDPUdQGGmRSYl9fDGcK4YgpAX5Tze2TX3+PAwfJ2zq98THtL\r\no//Dp8fIbwZ6smr+qG5OHsNitfOh8AQ+HA1It+D6mBTd8iGR+XYglHQbOnkE\r\nadWGQlhAlsrbWGPgf8+F546aJCtiXALFne0=\r\n=a71L\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":"^16.13.0 || >=18.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":"eeb780abfd1c0e95d7c5a1e4119acb2648368960","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/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":"9.6.2","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.16.0","dependencies":{"tslib":"^2.3.0","@nguniversal/common":"16.0.0-next.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-next.0_1680691281416_0.800839469482199","host":"s3://npm-registry-packages"},"_id":"@nguniversal/express-engine@16.0.0-next.0","version":"16.0.0-next.0"}