2019-08-22 10:30:48 +00:00
|
|
|
import * as express from 'express';
|
2019-09-01 13:52:59 +00:00
|
|
|
import * as hbs from 'hbs';
|
2019-08-22 10:30:48 +00:00
|
|
|
import * as path from 'path';
|
|
|
|
import * as bodyParser from 'body-parser';
|
|
|
|
import * as cors from 'cors';
|
2019-08-30 02:56:58 +00:00
|
|
|
import { init } from "./src"
|
2019-08-22 10:30:48 +00:00
|
|
|
|
|
|
|
const app = express();
|
2019-09-01 13:52:59 +00:00
|
|
|
app.engine('handlebars', hbs.__express);
|
|
|
|
app.set('views', __dirname + '/src/saml-idp/views');
|
|
|
|
app.set('view engine', 'hbs');
|
|
|
|
app.set('view options', { layout: 'layout' })
|
2019-08-22 10:30:48 +00:00
|
|
|
app.use(bodyParser.json());
|
|
|
|
app.use(bodyParser.urlencoded({ extended: true }));
|
|
|
|
app.use(cors());
|
|
|
|
|
2019-08-22 10:33:38 +00:00
|
|
|
app.get('/', (req, res) => {
|
2019-09-01 12:17:59 +00:00
|
|
|
res.redirect("/accounts/a");
|
2019-08-22 10:33:38 +00:00
|
|
|
res.end();
|
|
|
|
});
|
2019-08-30 02:56:58 +00:00
|
|
|
|
|
|
|
init({app});
|
2019-08-22 10:30:48 +00:00
|
|
|
|
|
|
|
app.listen(4000, () => {
|
|
|
|
console.log('Server listening on port 4000');
|
|
|
|
});
|