2.0.14-alpha.6 • Published 2 years ago
uhnoxi-music-web-prod v2.0.14-alpha.6
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.
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 to talk to. Defaults to/api
, but it's recommended to set this explicitly.options.emoji
- An object describing the 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 is configured to check for ReCaptcha entries.options.recaptcha.key
- ReCaptcha site key. This can be obtained from the "Keys" panel in the ReCaptcha site admin page.
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, using ReCaptcha and EmojiOne emoji from u-wave-web-emojione.
import express from 'express';
import createWebClient from 'u-wave-web/middleware';
import emojione from 'u-wave-web-emojione';
const app = express();
app.listen(6041);
app.use('/assets/emoji', emojione.middleware());
app.use('/', createWebClient({
// Use nginx to send this traffic to the API server.
apiBase: 'https://example.com/api',
emoji: emojione.emoji,
recaptcha: { key: 'my ReCaptcha site key' },
}));
License
2.0.14-alpha.6
2 years ago
2.0.13-alpha.6
2 years ago
2.0.11-alpha.6
2 years ago
2.0.10-alpha.6
2 years ago
2.0.9-alpha.6
2 years ago
2.0.8-alpha.6
2 years ago
2.0.6-alpha.6
2 years ago
2.0.5-alpha.6
2 years ago
2.0.0-alpha.6
2 years ago