server

Namespace

server

Description:
  • Server-side part of the soundworks framework.

    import '@soundworks/helpers/polyfills.js';
    import { Server } from '@soundworks/core/server.js';
    import { loadConfig } from '../utils/load-config.js';
    
    // - General documentation: https://soundworks.dev/
    // - API documentation:     https://soundworks.dev/api
    // - Issue Tracker:         https://github.com/collective-soundworks/soundworks/issues
    // - Wizard & Tools:        `npx soundworks`
    
    const config = loadConfig(process.env.ENV, import.meta.url);
    
    const server = new Server(config);
    server.setDefaultTemplateConfig();
    
    await server.start();
    
Source:

Classes

Client
Context
ContextManager
Plugin
PluginManager
Server
SharedState
SharedStateCollection
Socket
Sockets
StateManager

Type Definitions

ServerConfig

Description:
  • Configuration object for the server.

Source:
Properties:
Name Type Attributes Description
app object <optional>

Application configration object.

Properties
Name Type Attributes Default Description
clients object

Definition of the application clients.

name string <optional>
''

Name of the application.

author string <optional>
''

Name of the author.

env object <optional>

Environment configration object.

Properties
Name Type Attributes Default Description
port boolean

Port on which the server is listening.

useHttps boolean

Define is the server run in http or in https.

httpsInfos boolean <optional>
{}

Path to cert files for https.

serverAddress boolean

Domain name or IP of the server. Mandatory if node clients are defined

websockets string <optional>
{}

Configuration options for websockets.

subpath string <optional>
''

If running behind a proxy, path to the application.

Configuration object for the server.

Type:
  • object