This application serves up the OpenCert template renderers for SSG Accredited institutions submitted prior to 31st Dec 2019.
See also:
npm install
npm run dev
For Windows you need to set up the toolchain for node-gyp before installing this repository, follow the instructions in https://github.com/nodejs/node-gyp#on-windows.
npm install
npm run dev
The expected output of running npm run dev
is a blank screen, as this page is not a standalone application. It expects the caller to inject the certificate that is meant to be rendered.
For development purposes, there are two methods to effect the rendering of a certificate:
- Inject the certificate using the browser developer console, by running the command
window.opencerts.renderDocument(certificate)
, where thecertificate
variable has been initialised with the certificate contents - Run this
legacy-templates
repository usingnpm run dev
and keep it running, then run theopencerts-website
repository concurrently with thenpm run start:local
command. You can then preview rendering using the usual OpenCerts.io UI at http://localhost:3001.
To enable debug logs in the browser, set localStorage.debug="*"
If you see module build failure message like:
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: ENOENT: no such file or directory, scandir 'D:\opencerts-website\node_modules\node-sass\vendor'
at Object.readdirSync (fs.js:783:3)
Try running npm rebuild