Options
All
  • Public
  • Public/Protected
  • All
Menu
     

Interface Spaces

A plain-object, describing a collection of NameSpaces (or simply, Spaces) that will be used to serve webpages/files, handle data-reqests, and/or authenitcation.

Example

These are placed in config/namespaces.cfg.js.

module.exports = {
    PUSH:       [
        { enc: 'Base64', path: '/public/images/logo.png' },
        { enc: 'utf8',   path: '/public/js/vendor.js' },
        { enc: 'utf8',   path: '/public/js/engine.js' },
    ],
    Global:     { // RESERVED ~ !!!
        config: { ... },
        expose: ['accessor','rest'],
    },
    Accessor:   { // RESERVED ~ !!!
        type:       'auth',
        config:     { ... },
    },
    REST:       { // RESERVED ~ !!!
        type:       'rest',
        config:     { ... },
    },
    Error:      {
        type:       'page',
        config:     {
            name:        'error',
            scheme:      '/404/',
            title:       '404 Error',
            description: 'Displaying Errors',
            page:        {
                title:      () => '404 Error',
                CSS:        ['style'],
                styles:      false,
                main:       'evectr',
                type:       'jumbo',
            },
        },
    },
    Home:       {
        type:       'page',
        config:     {
            name:        'home',
            scheme:      '/home/',
            title:       'Home Page',
            description: 'Landing Page',
            page:        {
                title:      () => ('Welcome to My Page'),
                CSS:        ['styles','font-awesome'],
                main:       'stock',
                type:       'jumbo',
            },
        },
    },
};

Hierarchy

  • Spaces

Indexable

[spaceKey: string]: Space

Any custom page, rest, or auth Spaces you include in your project will be configure as above. The stringName is just an unique-identifier used for logging purposes.

Example

    Home:       {
        type:       'page',
        config:     {
            name:        'home',
            scheme:      '/home/',
            title:       'Home Page',
            description: 'Landing Page',
            page:        {
                title:      () => ('Welcome to My Page'),
                CSS:        ['styles','font-awesome'],
                main:       'stock',
                type:       'jumbo',
            },
        },
    },

Index

Client Properties

Default Object literals

Stock Object literals

Client Properties

PUSH

PUSH: Push[]

A list of SPCE.Push objects, each describing a File that will always be HTTP-PUSHED to the Client Browser when pages are requested.

Default Object literals

Global

Global: object

The Global Space confirguration. The default string-properties can be alter to your liking, and other, custom auth/rest Spaces can be added to the expose-property list.

expose

expose: ["accessor", "rest"] = ['accessor','rest']

config

config: object

name

name: string = "global"

title

title: string = "API Remoter"

description

description: string = "Server API Access"

Stock Object literals

Accessor

Accessor: object

The main authenticator. If using authentication (configured in config/setting.cfg.js), this is Space that would handle this. You can also secondary, custom auth Spaces.

type

type: "auth" = "auth"

config

config: object

name

name: string = "accessor"

title

title: string = "API Authoriser"

description

description: string = "Granting Access"

accessor

accessor: true = true

page

page: null = null

REST

REST: object

The main data-request Space. You can also secondary, custom rest Spaces.

type

type: "rest" = "rest"

config

config: object

name

name: string = "rest"

title

title: string = "API Explorer"

description

description: string = "Querying Data"

accessor

accessor: false = false

page

page: null = null