This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
wikipedia-game-solver/apps/api/src/config/app.ts

38 lines
1.0 KiB
TypeScript
Raw Normal View History

2024-08-09 23:51:41 +02:00
import env from "#start/env.js"
import { Secret } from "@adonisjs/core/helpers"
import { defineConfig } from "@adonisjs/core/http"
import app from "@adonisjs/core/services/app"
/**
* The app key is used for encrypting cookies, generating signed URLs, and by the "encryption" module.
*
* The encryption module will fail to decrypt data if the key is lost or changed.
* Therefore it is recommended to keep the app key secure.
*/
export const appKey = new Secret(env.get("APP_KEY"))
/**
* The configuration settings used by the HTTP server
*/
export const http = defineConfig({
generateRequestId: true,
allowMethodSpoofing: false,
/**
* Enabling async local storage will let you access HTTP context from anywhere inside your application.
*/
useAsyncLocalStorage: false,
/**
* Manage cookies configuration. The settings for the session id cookie are defined inside the "config/session.ts" file.
*/
cookie: {
domain: "",
path: "/",
maxAge: "2h",
httpOnly: true,
secure: app.inProduction,
sameSite: "lax",
},
})