2020-02-07 06:41:42 +00:00
|
|
|
require('dotenv-flow').config();
|
|
|
|
|
|
|
|
import * as express from 'express';
|
|
|
|
import * as hbs from 'hbs';
|
|
|
|
import * as path from 'path';
|
|
|
|
import * as bodyParser from 'body-parser';
|
|
|
|
import * as cors from 'cors';
|
|
|
|
import { init } from "./src";
|
2020-02-07 09:21:24 +00:00
|
|
|
import { isMeteor } from '@steedos/objectql';
|
2020-03-11 09:26:14 +00:00
|
|
|
const initConfig = require("@steedos/core/lib/init/init-config.json");
|
2020-02-07 06:41:42 +00:00
|
|
|
|
|
|
|
var server = require('@steedos/meteor-bundle-runner');
|
|
|
|
var steedos = require('@steedos/core')
|
2020-02-07 09:21:24 +00:00
|
|
|
|
|
|
|
declare var Meteor;
|
|
|
|
|
2020-02-07 06:41:42 +00:00
|
|
|
server.Fiber(function () {
|
|
|
|
try {
|
|
|
|
server.Profile.run("Server startup", function () {
|
|
|
|
server.loadServerBundles();
|
2020-03-11 09:26:14 +00:00
|
|
|
|
2022-07-06 07:56:34 +00:00
|
|
|
initConfig.built_in_plugins = []
|
2020-03-11 09:26:14 +00:00
|
|
|
|
2020-02-07 06:41:42 +00:00
|
|
|
steedos.init();
|
|
|
|
|
2020-02-07 09:21:24 +00:00
|
|
|
server.callStartupHooks();
|
|
|
|
|
2020-02-07 06:41:42 +00:00
|
|
|
const app = express();
|
|
|
|
app.engine('handlebars', hbs.__express);
|
|
|
|
app.set('views', __dirname + '/src/saml-idp/views');
|
|
|
|
app.set('view engine', 'hbs');
|
|
|
|
app.set('view options', { layout: 'layout' })
|
|
|
|
app.use(bodyParser.json());
|
|
|
|
app.use(bodyParser.urlencoded({ extended: true }));
|
|
|
|
app.use(cors({origin: true, credentials: true}));
|
|
|
|
|
2020-02-07 09:21:24 +00:00
|
|
|
init({app: app, settings: Meteor.settings});
|
2020-02-07 06:41:42 +00:00
|
|
|
|
|
|
|
server.runMain();
|
|
|
|
})
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error.stack)
|
|
|
|
}
|
|
|
|
}).run()
|