minimal passport
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Translation
|
||||
* translation
|
||||
*/
|
||||
|
||||
import i18next from "i18next";
|
||||
@@ -7,7 +7,7 @@ import resourcesToBackend from "i18next-resources-to-backend";
|
||||
|
||||
i18next.use(resourcesToBackend((language: string, namespace: string) => import(`../../shared-operations/public/locales/${namespace}/${language}.json`)))
|
||||
.init({
|
||||
debug: true,
|
||||
debug: false,
|
||||
ns: ["common"], // Preload this namespace, no need to add the others, they will load once their module is loaded
|
||||
defaultNS: "common",
|
||||
fallbackLng: "en",
|
||||
@@ -25,16 +25,42 @@ console.log("Available Modules: ", listOperatorNames());
|
||||
* jobs
|
||||
*/
|
||||
|
||||
import "./jobs";
|
||||
import "./jobs/jobs-controller";
|
||||
|
||||
/*
|
||||
* API
|
||||
* EXPRESS
|
||||
*/
|
||||
|
||||
import express from "express";
|
||||
const app = express();
|
||||
const PORT = 8000;
|
||||
|
||||
/*
|
||||
* auth
|
||||
*/
|
||||
|
||||
import passport from "passport";
|
||||
import session from "express-session";
|
||||
import { initialize } from "./auth/passport-config";
|
||||
import auth from "./routes/auth/auth-controller";
|
||||
|
||||
app.use(session({
|
||||
secret: process.env.SESSION_SECRET || "default-secret",
|
||||
resave: false,
|
||||
saveUninitialized: false
|
||||
}));
|
||||
|
||||
app.use(passport.initialize());
|
||||
app.use(passport.session());
|
||||
|
||||
initialize(passport);
|
||||
|
||||
app.use("/auth", auth);
|
||||
|
||||
/*
|
||||
* api
|
||||
*/
|
||||
|
||||
import api from "./routes/api/api-controller";
|
||||
app.use("/api", api);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user