JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q73288F

Express HTML snapshots middleware

Package Exports

  • express-html-snapshots

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (express-html-snapshots) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

#express-html-snapshots

Build Status

Provides a useful middleware for express that allows heavy javascript web applications to be crawled by search engines.

How to install

npm install express-html-snapshots

How to run tests

npm test

How to use

You can take a look at the sample application (https://github.com/OpenifyIt/express-html-snapshots/tree/master/samples/angularjs)

Otherwise it's really straight forward.

var expressHTMLSnapshots = require('express-html-snapshots');

app.configure(function(){
    // ...
    app.use(expressHTMLSnapshots.middleware); // it must be placed before the app.router
    app.use(app.router);
    // ...
});

You can also use directly the snapshot function

var expressHTMLSnapshots = require('express-html-snapshots');

expressHTMLSnapshots.snapshopt(url, function(err, html){
    console.log(err, html);
});