u-wave-web

2.0.0-alpha.32 • Public • Published

u-wave-web

Web client for üWave.

This package contains the compiled client side and server-side middleware. This is all you need to serve the web client.

Screenshot

API

import createWebClient from 'u-wave-web/middleware';

createWebClient(options={})

Create a Web client middleware for use with express-style server libraries.

Parameters

  • options
    • options.apiBase - Base URL to the mount point of the [üWave Web API][u-wave-core] to talk to. Defaults to /api, but it's recommended to set this explicitly.

    • options.emoji - An object describing the custom emoji that will be available in the chat. Keys are emoji shortcodes (without :), and values are image filenames.

    • options.recaptcha - An object containing ReCaptcha options used to ensure new user registrations are human. This option should only be passed if the [HTTP API][u-wave-core] is configured to check for ReCaptcha entries.

    • options.title - Document title, what's shown in the tab by the browser. Default "üWave".

Example

This is a small example üWave server on top of Express.

import express from 'express';
import createWebClient from 'u-wave-web/middleware';

const app = express();

app.listen(6041);

app.use('/', createWebClient({
  // Use nginx to send this traffic to the API server.
  apiBase: 'https://example.com/api',
  recaptcha: { key: 'my ReCaptcha site key' },
}));

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i u-wave-web

Weekly Downloads

1

Version

2.0.0-alpha.32

License

MIT

Unpacked Size

11 MB

Total Files

3715

Last publish

Collaborators

  • waf
  • goto-bus-stop