actionhero
Version:
actionhero.js is a multi-transport API Server with integrated cluster capabilities and delayed tasks
45 lines (44 loc) • 2.05 kB
JavaScript
;
// Note that to use the websocket server, you also need the web server enabled
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT = void 0;
exports.DEFAULT = {
servers: {
websocket: (config) => {
return {
enabled: true,
// you can pass a FQDN (string) here or 'window.location.origin'
clientUrl: "window.location.origin",
// Directory to render client-side JS.
// Path should start with "/" and will be built starting from api.config..general.paths.public
clientJsPath: "javascript/",
// the name of the client-side JS file to render. Both `.js` and `.min.js` versions will be created
// do not include the file extension
// set to `undefined` to not render the client-side JS on boot
clientJsName: "ActionheroWebsocketClient",
// should the server signal clients to not reconnect when the server is shutdown/reboot
destroyClientsOnShutdown: false,
// websocket Server Options:
server: {
// authorization: null,
// pathname: '/primus',
// parser: 'JSON',
// transformer: 'websockets',
// plugin: {},
// timeout: 35000,
// origins: '*',
// methods: ['GET','HEAD','PUT','POST','DELETE','OPTIONS'],
// credentials: true,
// maxAge: '30 days',
// exposed: false,
},
// websocket Client Options:
client: {
apiPath: "/api",
// the cookie name we should use for shared authentication between WS and web connections
cookieKey: config.servers.web.fingerprintOptions.cookieKey,
},
};
},
},
};