Nebula serve

Run a nebula visualization with a basic web development server

Usage

nebula serve

Example

Connect to enigma on port 9077 to start the server

nebula serve --enigma.port 9077

Start the server without building the visualization

nebula serve --build false

Start the server and set a generic object type with sn-table

nebula serve --type sn-table

Start the server with a nebula configuration json file in a new path

nebula serve --type combochart --config config/my-nebula-config.js

Options

ParameterDescriptionDefault
--versionShow version number
--config, -c stringSet path to JSON config file"nebula.config.js"
--entry stringSet file entrypoint
--type stringSet generic object type
--buildBuild the nebula visualization into /dist dictionarytrue
--host string"localhost"
--port number
--disableHostCheckfalse
--resources stringSet path to a folder served as static files under \resources
--scripts arraySet array of scripts to inject
--stylesheets arraySet array of stylesheets to inject
--enigma.host stringSet host name"localhost"
--enigma.port numberSet port name9076
--webIntegrationId string
--ACCEPT_EULAfalse
-h, --helpShow help for command

Details

Using node.js API

const serve = require('@nebula.js/cli-serve');

serve({
  port: 3000,
  entry: path.resolve(__dirname, 'sn.js') // custom entrypoint
  enigma: {
    port: 9077
  }
}).then(s => {
  s.url; // serve url
  s.close(); // close the server
});

It can be used for automated tests.

Configuration file

nebula.config.js

module.exports = {
  serve: {
    ...,
  },
};

Serve properties:

  • types: Additional types to load into the serve instance. Useful in conjunction with useEmbed.
    • ex: types: [{ name: 'barchart', url: "https://unpkg.com/@nebula.js/sn-bar-chart"}],
  • themes: Theme files to load
    • ex: themes: [{ id: 'sense', theme: { /* valid sense json theme */ } }],
  • renderConfigs: configuration for the test renderer
  • flags: Additional flag settings for feature toggling
    • flags: { SOME_FEATURE: true }
  • resources: Adds path to /resources
  • snapshots: Snapshots property structure, generally used for automated tests.

When themes are correctly set, you can select the themes at the top-right corner of the running app.

theme selection in current app
Was this page helpful?