• This router implements all Ajax calls necessary for the H5P (editor) client to work. Use it like this: server.use('/h5p', H5P.adapters.express(h5pEditor, path.resolve('h5p/core'), path.resolve('h5p/editor'))); If you only want certain routes, you can specify this in the options parameter.

    Parameters

    • h5pEditor: H5PEditor

      the editor object

    • h5pCorePath: string

      the path on the local disk at which the core files (of the player) can be found

    • h5pEditorLibraryPath: string

      the path on the local disk at which the core files of the editor can be found

    • routeOptions: H5PAjaxExpressRouterOptions = ...

      sets which routes you want and how to handle errors

    • languageOverride: string = 'auto'

      the language to use when returning errors. Only has an effect if you use the i18next http middleware, as it relies on req.i18n.changeLanguage to be present. Defaults to auto, which means the a language detector must have detected language and req.t translated to the detected language.

    Returns Router