Initial commit: PC Builder AdonisJS project
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
import app from '@adonisjs/core/services/app'
|
||||
import { defineConfig } from '@adonisjs/core/http'
|
||||
|
||||
/**
|
||||
* The configuration settings used by the HTTP server
|
||||
*/
|
||||
export const http = defineConfig({
|
||||
/**
|
||||
* Generate a unique request id for each incoming request.
|
||||
* Useful to correlate logs and debug a request flow.
|
||||
*/
|
||||
generateRequestId: true,
|
||||
|
||||
/**
|
||||
* Allow HTTP method spoofing via the "_method" form/query parameter.
|
||||
* This lets HTML forms target PUT/PATCH/DELETE routes while still
|
||||
* submitting with POST.
|
||||
*/
|
||||
allowMethodSpoofing: false,
|
||||
|
||||
/**
|
||||
* Enabling async local storage will let you access HTTP context
|
||||
* from anywhere inside your application.
|
||||
*/
|
||||
useAsyncLocalStorage: false,
|
||||
|
||||
/**
|
||||
* Redirect configuration controls the behavior of
|
||||
* response.redirect().back() and query string forwarding.
|
||||
*/
|
||||
redirect: {
|
||||
/**
|
||||
* When enabled, all redirects automatically carry over the current
|
||||
* request's query string parameters to the redirect destination.
|
||||
* Use withQs(false) to opt out for a specific redirect.
|
||||
*/
|
||||
forwardQueryString: true,
|
||||
},
|
||||
|
||||
/**
|
||||
* Manage cookies configuration. The settings for the session id cookie are
|
||||
* defined inside the "config/session.ts" file.
|
||||
*/
|
||||
cookie: {
|
||||
/**
|
||||
* Restrict the cookie to a specific domain.
|
||||
* Keep empty to use the current host.
|
||||
*/
|
||||
domain: '',
|
||||
|
||||
/**
|
||||
* Restrict the cookie to a URL path. '/' means all routes.
|
||||
*/
|
||||
path: '/',
|
||||
|
||||
/**
|
||||
* Default lifetime for cookies managed by the HTTP layer.
|
||||
*/
|
||||
maxAge: '2h',
|
||||
|
||||
/**
|
||||
* Prevent JavaScript access to the cookie in the browser.
|
||||
*/
|
||||
httpOnly: true,
|
||||
|
||||
/**
|
||||
* Send cookies only over HTTPS in production.
|
||||
*/
|
||||
secure: app.inProduction,
|
||||
|
||||
/**
|
||||
* Cross-site policy for cookie sending.
|
||||
*/
|
||||
sameSite: 'lax',
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user