var express = require('express');
var bodyparser = require('body-parser');
const portHTTP = 80;
const portHTTPS = 8018;

var app = express();
app.use(bodyparser.urlencoded({extended: true}));
app.use(bodyparser.json());

//https
var fs = require('fs');
var https_options = {
key: fs.readFileSync("./key/private.key"),
cert: fs.readFileSync("./key/chatgpt_dev_bravesoft_vn.crt"),
ca: [
  fs.readFileSync('./key/chatgpt_dev_bravesoft_vn.ca-bundle')
]
};
var https = require('https').createServer(https_options, app);

https.listen(portHTTPS, function(){
  console.log('https listening on *:' + portHTTPS);
})

require("./controller/main_navigation")(app);
