authelia/server/src/index.ts

29 lines
755 B
TypeScript
Raw Normal View History

#! /usr/bin/env node
2017-05-16 21:17:46 +00:00
import Server from "./lib/Server";
import { GlobalDependencies } from "../types/Dependencies";
import YAML = require("yamljs");
const configurationFilepath = process.argv[2];
if (!configurationFilepath) {
console.log("No config file has been provided.");
console.log("Usage: authelia <config>");
process.exit(0);
}
2017-07-13 22:25:11 +00:00
const yamlContent = YAML.load(configurationFilepath);
const deps: GlobalDependencies = {
u2f: require("u2f"),
ldapjs: require("ldapjs"),
session: require("express-session"),
winston: require("winston"),
speakeasy: require("speakeasy"),
nedb: require("nedb"),
2018-03-28 22:04:59 +00:00
ConnectRedis: require("connect-redis"),
Redis: require("redis")
};
const server = new Server(deps);
server.start(yamlContent, deps);