Commit 4c0e0e97 authored by Roberto Toro's avatar Roberto Toro

preparing passage to wss

parent ba053171
......@@ -26,3 +26,4 @@ view/atlasMaker/dist/
view/atlasMaker/src/tools/dist/
view/brainbox/dist/
whitelist.json
ws_cfg.json
......@@ -6,10 +6,10 @@
"start": "PORT=3001 node ./bin/www",
"prepare": "./scripts/build.sh",
"build-atlasmaker": "webpack --config webpack.atlasmaker.config.js && cp view/atlasMaker/dist/atlasMaker.js public/lib/atlasMaker.js",
"build-atlasmaker-tools": "webpack --config webpack.atlasmaker-tools.config.js && cp -r view/atlasMaker/dist/atlasMaker-tools public/lib/",
"build-brainbox": "webpack --config webpack.brainbox.config.js && cp view/brainbox/dist/brainbox.js public/lib/brainbox.js",
"build-pages": "webpack --config webpack.pages.config.js && cp view/brainbox/dist/*-page.js public/js/",
"build-tools": "mkdir -p public/lib/atlasMaker-tools && cp -r view/atlasMaker/src/tools/dist/*.js public/lib/atlasMaker-tools/",
"build": "npm run build-atlasmaker && npm run build-brainbox && npm run build-pages && npm run build-tools",
"build": "npm run build-atlasmaker && npm run build-atlasmaker-tools && npm run build-brainbox && npm run build-pages",
"mocha-test": "mocha ./test/runner.js test/unit/*.js test/integration/*.js",
"lint": "eslint .",
"test": "docker exec brainbox_web_1 /bin/bash -c 'cd /brainbox && npm run mocha-test'"
......
......@@ -40,8 +40,11 @@ export var AtlasMakerWS = {
return new Promise(function (resolve, reject) {
// WS connection
//var host = "ws://" + window.location.hostname + ":8080/";
var host = me.wshostname;
if(me.secure) {
host = "wss://" + me.wshostname;
} else {
host = "ws://" + me.wshostname;
}
if (me.debug) { console.log("[initSocketConnection] host:", host); }
if (me.progress) { me.progress.html("Connecting..."); }
......
......@@ -26,7 +26,7 @@ export var AtlasMakerWidget = {
//========================================================================================
debug: 1,
hostname: 'http://localhost:3001', // '', // 'http://brainbox.pasteur.fr',
wshostname: 'ws://localhost:8080', // 'ws://brainbox.pasteur.fr:8080',
wshostname: 'localhost:8080', // 'ws://brainbox.pasteur.fr:8080',
container: null, // Element where atlasMaker lives
brain_offcn: null,
brain_offtx: null,
......@@ -104,7 +104,8 @@ export var AtlasMakerWidget = {
info:{}, // information displayed over each brain slice
// undo stack
/* DEPRECATED Undo:[], */
version: 1, // version of the configuration file (slice number, plane, etc). Default=1
secure: true,
version: 1, // version of the configuration file (slice number, plane, etc). Default=1
/**
* @function quit
......
......@@ -2,10 +2,11 @@ const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
var glob = require("glob");
const list = glob.sync("./*/index.js");
const list = glob.sync("./view/atlasMaker/src/tools/*/index.js");
const entries = {};
for(const item of list) {
const key = item.split('/')[1];
const arr = item.split('/');
const key = arr[arr.length-2]; // module name is directory's name
entries[key] = item;
};
console.log(entries);
......@@ -19,7 +20,7 @@ module.exports = {
],
output: {
filename: '[name].js',
path: path.resolve(__dirname, './dist')
path: path.resolve(__dirname, 'view/atlasMaker/dist/atlasMaker-tools')
},
module: {
rules: [
......
{
"port": 8080,
"ssl_key": "/path/to/privkey.pem",
"ssl_cert": "/path/to/fullchain.pem",
"ssl_chain": "/path/to/chain.pem"
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment