Skip to content
Snippets Groups Projects
Commit da678a86 authored by Aymeric Bernard's avatar Aymeric Bernard
Browse files

Fix: protocol and port for https for front on server

parent b8946e82
No related branches found
No related tags found
No related merge requests found
module.exports = { module.exports = {
port: 5000, protocol: 'http',
host: 'localhost', host: 'localhost',
port: 5000,
}; };
import { port, host } from './config'; import { protocol, host, port } from './config';
const socketIO = io.connect(`http://${host || 'localhost'}:${port || 3000}/`); const socketIO = io.connect(`${protocol}://${host || 'localhost'}:${port}/`);
socketIO.on('connect', () => { socketIO.on('connect', () => {
socketIO.emit('date'); socketIO.emit('date');
......
...@@ -56,7 +56,6 @@ img.row-icon { ...@@ -56,7 +56,6 @@ img.row-icon {
margin-left: 10px; margin-left: 10px;
padding-top: 10px; padding-top: 10px;
padding-bottom: 10px; padding-bottom: 10px;
border: 1px solid #ccc;
} }
.image-text-bloc > .text-section > .text-element:last-child { .image-text-bloc > .text-section > .text-element:last-child {
......
...@@ -3,6 +3,7 @@ const path = require('path'); ...@@ -3,6 +3,7 @@ const path = require('path');
module.exports = { module.exports = {
port: 5000, port: 5000,
secure: false,
uuid: 'UUID A REMPLIR', uuid: 'UUID A REMPLIR',
api: { api: {
url: 'http://api.hermod.cs-campus.fr', url: 'http://api.hermod.cs-campus.fr',
......
...@@ -2,7 +2,7 @@ const http = require('http'); ...@@ -2,7 +2,7 @@ const http = require('http');
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const socketIO = require('socket.io'); const socketIO = require('socket.io');
const { port } = require('./config'); const { port, secure } = require('./config');
const socket = require('./socket'); const socket = require('./socket');
const indexPath = path.resolve(__dirname, '../front/build/index.html'); const indexPath = path.resolve(__dirname, '../front/build/index.html');
...@@ -29,6 +29,6 @@ const server = (req, res) => { ...@@ -29,6 +29,6 @@ const server = (req, res) => {
const app = http.createServer(server); const app = http.createServer(server);
app.listen(port || 3000); app.listen(port || 3000);
const io = socketIO(app); const io = socketIO(app, { secure });
io.of('/').on('connection', socket); io.of('/').on('connection', socket);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment