Commit 9771403d authored by Yoann HOUPERT's avatar Yoann HOUPERT

clean code

parent 9d7581e6
Pipeline #6686 passed with stage
in 30 seconds
......@@ -17,6 +17,8 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const https = require('https');
const fs = require('fs');
const app = require('express')();
const fileUpload = require('express-fileupload');
......@@ -25,9 +27,6 @@ const bodyParser = require('body-parser');
const config = require('./config.json');
const routes = require('./lib/webserver/routes');
const fs = require('fs');
const https = require('https');
console.log('starting routes linstt-controller...');
app.use(bodyParser.raw({type: 'audio/wav', limit: '200mb'}));
......@@ -35,13 +34,14 @@ app.use(fileUpload());
app.use('/', routes.routesFactory(config.orchestrator));
app.listen(config.api, () => {
console.log('App listening on port 3000');
console.log('App HTTP listening on port 3000');
});
https.createServer({
key: fs.readFileSync('ssl/key.pem'),
cert: fs.readFileSync('ssl/cert.pem')
}, app).listen(config.apiSsl);
}, app).listen(config.apiSsl, () => {
console.log('App HTTPS listening on port 3001');
});
console.log('routes started linstt-controller...');
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