nguniversal-express-engine-meta-tags-replacer
v1.0.0
Published
![language](https://img.shields.io/badge/language-JavaScript-yellow.svg) ![license](https://img.shields.io/badge/license-ISC-green) [![npm version](https://img.shields.io/npm/v/nguniversal-express-engine-meta-tags-replacer.svg?style=flat)](https://npmjs
Downloads
1
Maintainers
Readme
nguniversal-express-engine-meta-tags-replacer
Description
This package provides a function for handling the page request in
Angular SSR app, which needs its specific meta
tag content
attribute
value. This can be mostly used for Facebook sharing.
Installation
npm i nguniversal-express-engine-meta-tags-replacer
Usage example:
import { metaTagsReplacerRequestHandler, IMetaTag } from 'nguniversal-express-engine-meta-tags-replacer'
import { APP_BASE_HREF } from '@angular/common'
server.get(['/some-path'], (req, res) => {
metaTagsReplacerRequestHandler(
indexHtml,
{
req,
providers: [
{ provide: APP_BASE_HREF, useValue: req.baseUrl }
]
},
res,
[
{
propertyValue: 'og:image',
contentValue: '/page/specific/image'
},
{
propertyValue: 'og:title',
contentValue: 'Page specific title'
}
] as IMetaTag[]
)
})