Introduced Secrets Manager
This commit is contained in:
@@ -22,9 +22,11 @@ import exportRoutes from "./routes/exports"
|
||||
import emailAsUserRoutes from "./routes/emailAsUser";
|
||||
|
||||
import {sendMail} from "./utils/mailer";
|
||||
import {loadSecrets, secrets} from "./utils/secrets";
|
||||
|
||||
async function main() {
|
||||
const app = Fastify({ logger: true });
|
||||
await loadSecrets();
|
||||
|
||||
/*app.addHook("onRequest", (req, reply, done) => {
|
||||
console.log("Incoming:", req.method, req.url, "Headers:", req.headers)
|
||||
@@ -37,7 +39,7 @@ async function main() {
|
||||
await app.register(supabasePlugin);
|
||||
await app.register(tenantPlugin);
|
||||
app.register(fastifyCookie, {
|
||||
secret: process.env.COOKIE_SECRET || "supersecret", // optional, für signierte Cookies
|
||||
secret: secrets.COOKIE_SECRET,
|
||||
})
|
||||
// Öffentliche Routes
|
||||
await app.register(authRoutes);
|
||||
@@ -68,8 +70,8 @@ async function main() {
|
||||
|
||||
// Start
|
||||
try {
|
||||
await app.listen({ port: 3100, host: "0.0.0.0" });
|
||||
console.log("🚀 Server läuft auf http://localhost:3100");
|
||||
await app.listen({ port: secrets.PORT, host: secrets.HOST });
|
||||
console.log(`🚀 Server läuft auf http://${secrets.HOST}:${secrets.PORT}`);
|
||||
} catch (err) {
|
||||
app.log.error(err);
|
||||
process.exit(1);
|
||||
|
||||
Reference in New Issue
Block a user