| Sep |
OCT |
Nov |
|
28 |
|
| 2020 |
2021 |
2022 |
About this capture
Web crawl data from Common Crawl.
The Wayback Machine - http://web.archive.org/web/20211028060958/https://github.com/Angular-RU/universal-starter
Skip to content
Sign up
●
Features →
●Mobile →
●Actions →
●Codespaces →
●Packages →
●Security →
●Code review →
●Issues →
●Integrations →
●GitHub Sponsors →
●Customer stories→
●
●
●
●Explore GitHub →
Learn and contribute
●Topics →
●Collections →
●Trending →
●Learning Lab →
●Open source guides →
Connect with others
●The ReadME Project →
●Events →
●Community forum →
●GitHub Education →
●GitHub Stars program →
●
●
Plans →
●Compare plans →
●Contact Sales →
●Education →
In this repository
All GitHub
↵
Jump to
↵
-
No suggested jump to results
{{ message }}
●
Notifications
Star
539
●
Fork
202
Angular 9 Universal repo with many features
ssr9.gorniv.com
MIT License
539
stars
202
forks
Star
Notifications
●
Code
●
Issues
10
●
Pull requests
3
●
Actions
●
Projects
1
●
Wiki
●
Security
●
Insights
More
●
Code
●
Issues
●
Pull requests
●
Actions
●
Projects
●
Wiki
●
Security
●
Insights
Could not load branches
Nothing to show
ranches
Could not load tags
Nothing to show
9
branches
4
tags
Code
Latest commit
Git stats
●
480
commits
Files
Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
e2e
src
test
.dockerignore
.editorconfig
.gitignore
.prettierrc
.travis.yml
CHANGELOG.md
CODE_OF_CONDUCT.md
Dockerfile.csr
Dockerfile.ssr
LICENSE
README-RO.md
README-RU.md
README.md
angular.json
debug.md
defined.md
gzip.conf
karma.conf.js
mime.types
nginx.conf
ngsw-config.json
package-lock.json
package.json
prerender.ts
protractor.conf.js
renovate.json
server.bak.ts
server.ts
static.paths.ts
tsconfig.json
tslint.json
Angular RU Universal Starter 

If you like this project please show your support with a GitHub star. Much appreciated!
Repository with Angular CLI and Angular Universal
Translations:
●Русский
●English
●Românesc
Resources:
●public chat https://t.me/angular_universal_ru
●https://ssr.angular.su/ - server-side rendering of the master
●https://csr.angular.su/ - client rendering master
Plans:
● Angular 11
● document is not defined and window is not defined - here
● Angular Material2 UI components - individual branch
● Primeng UI components - [individual branch] (https://github.com/Angular-RU/angular-universal-starter/tree/primeng)
● modules import depending on the platform (MockServerBrowserModule)
● execution of queries to api on the server TransferHttp
● work with cookies on the server UniversalStorage
● Uses ngx-meta for SEO (title, meta tags, and Open Graph tags for social sharing).
● uses ngx-translate to support internationalization (i18n)
● uses ORIGIN_URL - for absolute queries
● @angular/service-worker(ng add @angular/pwa --project universal-demo)
How to start
●yarnornpm install
●yarn startornpm run start - for client rendering
●yarn ssrornpm run ssr - for server-side rendering
●yarn build:universalornpm run build:universal - for assembly in release
●yarn serverornpm run server - to start the server
●yarn build:prerenderornpm run build:prerender - to generate static by static.paths.ts
●for watch with ssr - npm run ssr:watch
How to use this repository in your project:
To transfer ssr to your repository, you need the following files:
●.angular-cli.json
●server.ts
●prerender.ts
●webpack.config.js
●main.server.ts
●main.browser.ts
●shared/*
●forStorage/*
●environments/*
●app.browser.module.ts
●app.server.module.ts
References
Official example in English: https://github.com/angular/universal-starter
Modules used for universal:
●https://github.com/angular/universal/tree/master/modules/aspnetcore-engine - web for .net core
●https://github.com/angular/universal/tree/master/modules/common - TransferHttpCacheModule for http request only server side and sync with TransferHttp for browser
●https://github.com/angular/universal/tree/master/modules/express-engine - Express Engine to run the rendering in node, in our application is used. Please note that the current version is not lower than 5.0.0-beta.5
●https://github.com/angular/universal/tree/master/modules/hapi-engine - Hapi Engine is an alternative engine for rendering. In the example is not used, in principle in the connection scheme does not differ from express-engine
●https://github.com/angular/universal/tree/master/modules/module-map-ngfactory-loader - the module search module for LazyLoading - the thing needed and used. Please note that the current version is not lower than 5.0.0-beta.5
Features (Important)
●The module for TransferHttp uses import {TransferState} from '@angular/platform-browser'; and it is necessary to implement the request rest api on the server and the absence of the second request a second time. See home.component.ts (delay 3c)
{
this.result = result;
});
">this.http.get('https://reqres.in/api/users?delay=3').subscribe(result => {
this.result = result;
});
export const AppRoutes = RouterModule.forRoot(routes, { initialNavigation: 'enabled' });- so that there is no flashing of the page!
to work with cookies, it is written AppStorage, which with DI allows you to give different implementations for the server and the browser. See server.storage.ts and browser.storage.ts for implementations. In server.ts there is
providers: [
{
provide: REQUEST, useValue: (req)
},
{
provide: RESPONSE, useValue: (res)
}
]
to work with REQUEST and RESPONSE via DI - this is necessary for implementing UniversalStorage when working with cookies.
●webpack.config.js is written exclusively for building server.ts file in server.js, since angular-cli has [bug](https: //github.com / angular/angular-cli/issues/7200) to work with 3d dependencies. - To solve some problems, use the following code in server.ts Solving the problems of global variables, including document is not defined and window is not defined
file.startsWith('styles'));
// const hashStyle = styleFiles[0].split('.')[1];
// const style = fs.readFileSync(path.join(__dirname, '.', 'dist-server', `styles.${hashStyle}.bundle.css`)).toString();
global['window'] = win;
Object.defineProperty(win.document.body.style, 'transform', {
value: () => {
return {
enumerable: true,
configurable: true
};
},
});
global['document'] = win.document;
global['CSS'] = null;
// global['XMLHttpRequest'] = require('xmlhttprequest').XMLHttpRequest;
global['Prism'] = null;
">const domino = require('domino');
const fs = require('fs');
const path = require('path');
const template = fs.readFileSync(path.join(__dirname, '.', 'dist', 'index.html')).toString();
const win = domino.createWindow(template);
const files = fs.readdirSync(`${process.cwd()}/dist-server`);
// const styleFiles = files.filter(file => file.startsWith('styles'));
// const hashStyle = styleFiles[0].split('.')[1];
// const style = fs.readFileSync(path.join(__dirname, '.', 'dist-server', `styles.${hashStyle}.bundle.css`)).toString();
global['window'] = win;
Object.defineProperty(win.document.body.style, 'transform', {
value: () => {
return {
enumerable: true,
configurable: true
};
},
});
global['document'] = win.document;
global['CSS'] = null;
// global['XMLHttpRequest'] = require('xmlhttprequest').XMLHttpRequest;
global['Prism'] = null;
global['navigator'] = req['headers']['user-agent'];
this allows you to remove some of the problems when working with undefined.
Migrate 5 to 6
●https://github.com/ReactiveX/rxjs-tslint
●ng update @angular/cli
●preboot is not working now
About
Angular 9 Universal repo with many features
ssr9.gorniv.com
Topics
angular
webpack
translation
universal
ssr
cookie
example
primeng
server-side-rendering
expressionengine
material2
Resources
Readme
License
MIT License
Angular 11
Latest
Apr 27, 2021
+ 2 releases
No packages published
+ 9 contributors
Languages
●
TypeScript
74.0%
●
SCSS
18.9%
●
HTML
4.9%
●
JavaScript
2.2%
●© 2021 GitHub, Inc.
●Terms
●Privacy
●Security
●Status
●Docs
●Contact GitHub
●Pricing
●API
●Training
●Blog
●About
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.