const express = require('express');
const config = require('./utils/config.js');
const middleware = require('./utils/middleware.js');
const routes = require('./routes/routes.js');
const auth = require('./utils/auth.js');

(async () => {
  const app = express();
  middleware.setup(app);
  await auth.initAuth(config.fileConfig);
  routes.setup(app);
  app.listen(config.PORT, '0.0.0.0', () => {
    //console.log(`LibrePortal Web UI running on http://0.0.0.0:${config.PORT}`);
  });
})();
