Title: I can't get the SSR project live · Issue #2 · ganatan/angular-node-java · GitHub
Open Graph Title: I can't get the SSR project live · Issue #2 · ganatan/angular-node-java
X Title: I can't get the SSR project live · Issue #2 · ganatan/angular-node-java
Description: Hello, I want to start by thanking you for your sharing. I cannot publish the project after the SSR compilation process. I did not have such a problem in the Angular 8 version. I can't publish after updating to 9. I can compile the proje...
Open Graph Description: Hello, I want to start by thanking you for your sharing. I cannot publish the project after the SSR compilation process. I did not have such a problem in the Angular 8 version. I can't publish afte...
X Description: Hello, I want to start by thanking you for your sharing. I cannot publish the project after the SSR compilation process. I did not have such a problem in the Angular 8 version. I can't publish ...
Opengraph URL: https://github.com/ganatan/angular-node-java/issues/2
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"I can't get the SSR project live","articleBody":"Hello,\r\n\r\nI want to start by thanking you for your sharing.\r\nI cannot publish the project after the SSR compilation process. I did not have such a problem in the Angular 8 version. I can't publish after updating to 9.\r\n\r\nI can compile the project. My \"browser\" and \"server\" folders are created in the \"dist\" folder. I am loading this to the server from the plesk panel and setting it to read the server / main.js file with node.js. However, the project does not open. Timed out.\r\n\r\nCould you help?\r\n\r\nserver.ts\r\n```\r\nimport 'zone.js/dist/zone-node';\r\n\r\nimport { ngExpressEngine } from '@nguniversal/express-engine';\r\nimport * as express from 'express';\r\nimport { join } from 'path';\r\n\r\nimport { AppServerModule } from './src/main.server';\r\nimport { APP_BASE_HREF } from '@angular/common';\r\nimport { existsSync } from 'fs';\r\n\r\nconst domino = require('domino'); // kb\r\nconst fs = require('fs'); // kb\r\nconst template = fs.readFileSync('dist/browser/index.html').toString(); // kb\r\nconst win = domino.createWindow(template); // kb\r\nglobal['window'] = win;\r\nglobal['document'] = win.document;\r\nglobal[\"branch\"] = null;\r\nglobal[\"object\"] = win.object;\r\nglobal['DOMTokenList'] = win.DOMTokenList;\r\nglobal['Node'] = win.Node;\r\nglobal['Text'] = win.Text;\r\nglobal['HTMLElement'] = win.HTMLElement;\r\nglobal['navigator'] = win.navigator;\r\n\r\n// The Express app is exported so that it can be used by serverless Functions.\r\nexport function app() {\r\n const server = express();\r\n const distFolder = join(process.cwd(), 'dist/browser');\r\n const indexHtml = existsSync(join(distFolder, 'index.original.html')) ? 'index.original.html' : 'index';\r\n\r\n // Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine)\r\n server.engine('html', ngExpressEngine({\r\n bootstrap: AppServerModule,\r\n }));\r\n\r\n server.set('view engine', 'html');\r\n server.set('views', distFolder);\r\n\r\n // Example Express Rest API endpoints\r\n // app.get('/api/**', (req, res) =\u003e { });\r\n // Serve static files from /browser\r\n server.get('*.*', express.static(distFolder, {\r\n maxAge: '1y'\r\n }));\r\n\r\n // All regular routes use the Universal engine\r\n server.get('*', (req, res) =\u003e {\r\n res.render(indexHtml, { req, providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }] });\r\n });\r\n\r\n return server;\r\n}\r\n\r\nfunction run() {\r\n const port = process.env.PORT || 4000;\r\n\r\n // Start up the Node server\r\n const server = app();\r\n server.listen(port, () =\u003e {\r\n console.log(`Node Express server listening on http://localhost:${port}`);\r\n });\r\n}\r\n\r\n// Webpack will replace 'require' with '__webpack_require__'\r\n// '__non_webpack_require__' is a proxy to Node 'require'\r\n// The below code is to ensure that the server is run only when not requiring the bundle.\r\ndeclare const __non_webpack_require__: NodeRequire;\r\nconst mainModule = __non_webpack_require__.main;\r\nconst moduleFilename = mainModule \u0026\u0026 mainModule.filename || '';\r\nif (moduleFilename === __filename || moduleFilename.includes('iisnode')) {\r\n run();\r\n}\r\n\r\nexport * from './src/main.server';\r\n\r\n```\r\n\r\nmain.server.ts\r\n```\r\nimport { enableProdMode } from '@angular/core';\r\n\r\nimport { environment } from './environments/environment';\r\n\r\nif (environment.production) {\r\n enableProdMode();\r\n}\r\n\r\nexport { AppServerModule } from './app/app.server.module';\r\nexport {ngExpressEngine} from '@nguniversal/express-engine';\r\n\r\nexport { renderModule, renderModuleFactory } from '@angular/platform-server';\r\n```\r\n\r\ntsconfig.app.json\r\n```\r\n{\r\n \"extends\": \"./tsconfig.json\",\r\n \"compilerOptions\": {\r\n \"outDir\": \"./out-tsc/app\",\r\n \"types\": []\r\n },\r\n \"files\": [\r\n \"src/main.ts\",\r\n \"src/polyfills.ts\"\r\n ],\r\n \"include\": [\r\n \"src/**/*.d.ts\"\r\n ]\r\n}\r\n\r\n```\r\n\r\ntsconfig.server.json\r\n```\r\n{\r\n \"extends\": \"./tsconfig.app.json\",\r\n \"compilerOptions\": {\r\n \"module\": \"commonjs\",\r\n \"outDir\": \"./out-tsc/app-server\",\r\n \"baseUrl\": \".\",\r\n \"types\": [\r\n \"node\"\r\n ]\r\n },\r\n \"angularCompilerOptions\": {\r\n \"entryModule\": \"./src/app/app.server.module#AppServerModule\"\r\n },\r\n \"files\": [\r\n \"src/main.server.ts\",\r\n \"server.ts\"\r\n ]\r\n}\r\n\r\n```\r\n\r\ntsconfig.json\r\n```\r\n{\r\n \"compileOnSave\": false,\r\n \"compilerOptions\": {\r\n \"baseUrl\": \"./\",\r\n \"outDir\": \"./dist/out-tsc\",\r\n \"sourceMap\": true,\r\n \"declaration\": false,\r\n \"module\": \"esnext\",\r\n \"moduleResolution\": \"node\",\r\n \"emitDecoratorMetadata\": true,\r\n \"experimentalDecorators\": true,\r\n \"importHelpers\": true,\r\n \"target\": \"es5\",\r\n \"typeRoots\": [\r\n \"node_modules/@types\"\r\n ],\r\n \"lib\": [\r\n \"es2018\",\r\n \"dom\"\r\n ]\r\n }\r\n}\r\n\r\n```\r\n\r\npackage.json\r\n```\r\n{\r\n \"name\": \"kodumunblogu\",\r\n \"version\": \"0.0.0\",\r\n \"scripts\": {\r\n \"ng\": \"ng\",\r\n \"start\": \"ng serve\",\r\n \"build\": \"ng build\",\r\n \"test\": \"ng test\",\r\n \"lint\": \"ng lint\",\r\n \"e2e\": \"ng e2e\",\r\n \"compile:server_bak\": \"webpack --config webpack.server.config.js --progress --colors\",\r\n \"build:ssr_bak\": \"npm run build:client-and-server-bundles \u0026\u0026 npm run compile:server\",\r\n \"serve:ssr_bak\": \"node dist/server\",\r\n \"build:client-and-server-bundles_bak\": \"ng build --prod --aot \u0026\u0026 ng run kodumunblogu:server:production --bundleDependencies all\",\r\n \"dev:ssr\": \"ng run kodumunblogu:serve-ssr\",\r\n \"serve:ssr\": \"node dist/server/main.js\",\r\n \"build:ssr\": \"ng build --prod \u0026\u0026 ng run kodumunblogu:server:production\",\r\n \"prerender\": \"ng run kodumunblogu:prerender\",\r\n \"postinstall\": \"ngcc\"\r\n },\r\n \"private\": true,\r\n \"dependencies\": {\r\n \"@angular/animations\": \"^9.0.0\",\r\n \"@angular/cdk\": \"^9.0.0\",\r\n \"@angular/common\": \"~9.0.0\",\r\n \"@angular/compiler\": \"~9.0.0\",\r\n \"@angular/core\": \"~9.0.0\",\r\n \"@angular/forms\": \"~9.0.0\",\r\n \"@angular/material\": \"^9.0.0\",\r\n \"@angular/platform-browser\": \"~9.0.0\",\r\n \"@angular/platform-browser-dynamic\": \"~9.0.0\",\r\n \"@angular/platform-server\": \"^9.0.0\",\r\n \"@angular/router\": \"~9.0.0\",\r\n \"@fortawesome/angular-fontawesome\": \"^0.6.0\",\r\n \"@fortawesome/fontawesome-svg-core\": \"^1.2.15\",\r\n \"@fortawesome/free-brands-svg-icons\": \"^5.7.2\",\r\n \"@fortawesome/free-solid-svg-icons\": \"^5.7.2\",\r\n \"@fullcalendar/core\": \"^4.3.1\",\r\n \"@nguniversal/express-engine\": \"^9.0.0\",\r\n \"@ngx-share/button\": \"^7.1.2\",\r\n \"@ngx-share/buttons\": \"^7.1.2\",\r\n \"@ngx-share/core\": \"^7.1.2\",\r\n \"bootstrap\": \"^4.3.1\",\r\n \"chart.js\": \"^2.9.3\",\r\n \"core-js\": \"^2.6.5\",\r\n \"express\": \"^4.17.1\",\r\n \"jquery\": \"^3.3.1\",\r\n \"primeicons\": \"^2.0.0\",\r\n \"primeng\": \"^9.0.0-rc.4\",\r\n \"quill\": \"^1.3.6\",\r\n \"rxjs\": \"~6.5.4\",\r\n \"tslib\": \"^1.10.0\",\r\n \"webpack-node-externals\": \"^1.7.2\",\r\n \"zone.js\": \"~0.10.2\"\r\n },\r\n \"devDependencies\": {\r\n \"@angular-devkit/build-angular\": \"~0.900.1\",\r\n \"@angular/cli\": \"~9.0.1\",\r\n \"@angular/compiler-cli\": \"~9.0.0\",\r\n \"@angular/language-service\": \"~9.0.0\",\r\n \"@nguniversal/builders\": \"^9.0.0\",\r\n \"@types/express\": \"^4.17.0\",\r\n \"@types/jasmine\": \"~3.3.10\",\r\n \"@types/jasminewd2\": \"~2.0.3\",\r\n \"@types/node\": \"^12.11.1\",\r\n \"codelyzer\": \"^5.1.2\",\r\n \"jasmine-core\": \"~3.3.0\",\r\n \"jasmine-spec-reporter\": \"~4.2.1\",\r\n \"karma\": \"~4.0.1\",\r\n \"karma-chrome-launcher\": \"~2.2.0\",\r\n \"karma-coverage-istanbul-reporter\": \"~2.0.5\",\r\n \"karma-jasmine\": \"~2.0.1\",\r\n \"karma-jasmine-html-reporter\": \"^1.4.0\",\r\n \"protractor\": \"~5.4.0\",\r\n \"ts-loader\": \"^4.0.0\",\r\n \"ts-node\": \"~8.0.3\",\r\n \"tslint\": \"~5.14.0\",\r\n \"typescript\": \"~3.7.5\",\r\n \"webpack-cli\": \"^3.1.0\"\r\n }\r\n}\r\n\r\n```","author":{"url":"https://github.com/MehmetSert","@type":"Person","name":"MehmetSert"},"datePublished":"2020-02-12T10:46:53.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":19},"url":"https://github.com/2/angular-node-java/issues/2"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:83714927-e1de-d770-3125-5e5444cba720 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9222:94CD2:148C73:1D656A:6A62177A |
| html-safe-nonce | eaee3d16e4f1c850234a6ec24628d3a7beace584063cae71d0e55405a20eb29b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjIyOjk0Q0QyOjE0OEM3MzoxRDY1NkE6NkE2MjE3N0EiLCJ2aXNpdG9yX2lkIjoiNTAxNjQ3NTA2NTY3ODY5ODM2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ac8c571dcc12b4ec695574126c377f23df981092ffcb680b54325ec59583c041 |
| hovercard-subject-tag | issue:563912321 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ganatan/angular-node-java/2/issue_layout |
| twitter:image | https://opengraph.githubassets.com/367985b33ac554222139070a18f500cc2f17333881acf418cb4d5f394aa1eea2/ganatan/angular-node-java/issues/2 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/367985b33ac554222139070a18f500cc2f17333881acf418cb4d5f394aa1eea2/ganatan/angular-node-java/issues/2 |
| og:image:alt | Hello, I want to start by thanking you for your sharing. I cannot publish the project after the SSR compilation process. I did not have such a problem in the Angular 8 version. I can't publish afte... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MehmetSert |
| hostname | github.com |
| expected-hostname | github.com |
| None | ccf61cb7ab435725b916ed640f57c45b2c4721db9469bc32656080efc5214b3e |
| turbo-cache-control | no-preview |
| go-import | github.com/ganatan/angular-node-java git https://github.com/ganatan/angular-node-java.git |
| octolytics-dimension-user_id | 32958393 |
| octolytics-dimension-user_login | ganatan |
| octolytics-dimension-repository_id | 159201496 |
| octolytics-dimension-repository_nwo | ganatan/angular-node-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 159201496 |
| octolytics-dimension-repository_network_root_nwo | ganatan/angular-node-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a7585b3d2ee639495a70ce464d0a18bad88ea12c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width