Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Environment or Server service for client/server #44

@PatrickJS

Description

@PatrickJS

A service for server concerns such as but not limited to SEO.
related interface proposals angular/angular#3144 (comment)
Either Environment that's bound by di to Server or Client. There is also an optimization step per environment that will be solved via Webpack build
prior art https://github.com/DerMambo/ms-seo

var robotTxt = `
  User-agent: Twitterbot
  Disallow:

  User-agent: *
  Disallow: /
`;

var metatags = `
  <meta name="twitter:card" content="summary" />
  <meta name="twitter:site" content="@nytimesbits" />
  <meta name="twitter:creator" content="@nickbilton" />
  <meta property="og:url" content="http://bits.blogs.nytimes.com/2011/12/08/a-twitter-for-my-sister/" />
  <meta property="og:title" content="A Twitter for My Sister" />
  <meta property="og:description" content="In the early days, Twitter grew so quickly that it was almost impossible to add new features because engineers spent their time trying to keep the rocket ship from stalling." />
  <meta property="og:image" content="http://graphics8.nytimes.com/images/2011/12/08/technology/bits-newtwitter/bits-newtwitter-tmagArticle.jpg" />
`;

@Component()
@View()
@RouteConfig()
class App {
  constructor(server: Server) {
    server.set('title', 'My home page');
    server.set('robot.txt', robotTxt);
    server.set('metatags', metatags);
  }
}
@Component({
  selector: 'app',
  bindings: [ bind(Environment).toClass(Server) ]
})
@View({
})
class App {
  constructor(env: Environment) {
  }
}

the idea here is replacing express with angular itself for a server framework. Where you have a Server App that has a view which is the Universal app

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions