diff options
author | vantezzen <properly@protonmail.com> | 2019-08-22 11:12:36 +0200 |
---|---|---|
committer | vantezzen <properly@protonmail.com> | 2019-08-22 11:12:36 +0200 |
commit | b018adf240679ec59a7344e30be39400f1ecd8af (patch) | |
tree | c076635761667dad302716b498088f1047281e46 /config/app.js | |
download | ferdium-server-b018adf240679ec59a7344e30be39400f1ecd8af.tar.gz ferdium-server-b018adf240679ec59a7344e30be39400f1ecd8af.tar.zst ferdium-server-b018adf240679ec59a7344e30be39400f1ecd8af.zip |
Initial commit
Diffstat (limited to 'config/app.js')
-rw-r--r-- | config/app.js | 243 |
1 files changed, 243 insertions, 0 deletions
diff --git a/config/app.js b/config/app.js new file mode 100644 index 0000000..4b4f7a5 --- /dev/null +++ b/config/app.js | |||
@@ -0,0 +1,243 @@ | |||
1 | 'use strict' | ||
2 | |||
3 | /** @type {import('@adonisjs/framework/src/Env')} */ | ||
4 | const Env = use('Env') | ||
5 | |||
6 | module.exports = { | ||
7 | |||
8 | /* | ||
9 | |-------------------------------------------------------------------------- | ||
10 | | Application Name | ||
11 | |-------------------------------------------------------------------------- | ||
12 | | | ||
13 | | This value is the name of your application and can used when you | ||
14 | | need to place the application's name in a email, view or | ||
15 | | other location. | ||
16 | | | ||
17 | */ | ||
18 | |||
19 | name: Env.get('APP_NAME', 'AdonisJs'), | ||
20 | |||
21 | /* | ||
22 | |-------------------------------------------------------------------------- | ||
23 | | App Key | ||
24 | |-------------------------------------------------------------------------- | ||
25 | | | ||
26 | | App key is a randomly generated 16 or 32 characters long string required | ||
27 | | to encrypt cookies, sessions and other sensitive data. | ||
28 | | | ||
29 | */ | ||
30 | appKey: Env.getOrFail('APP_KEY'), | ||
31 | |||
32 | http: { | ||
33 | /* | ||
34 | |-------------------------------------------------------------------------- | ||
35 | | Allow Method Spoofing | ||
36 | |-------------------------------------------------------------------------- | ||
37 | | | ||
38 | | Method spoofing allows to make requests by spoofing the http verb. | ||
39 | | Which means you can make a GET request but instruct the server to | ||
40 | | treat as a POST or PUT request. If you want this feature, set the | ||
41 | | below value to true. | ||
42 | | | ||
43 | */ | ||
44 | allowMethodSpoofing: true, | ||
45 | |||
46 | /* | ||
47 | |-------------------------------------------------------------------------- | ||
48 | | Trust Proxy | ||
49 | |-------------------------------------------------------------------------- | ||
50 | | | ||
51 | | Trust proxy defines whether X-Forwarded-* headers should be trusted or not. | ||
52 | | When your application is behind a proxy server like nginx, these values | ||
53 | | are set automatically and should be trusted. Apart from setting it | ||
54 | | to true or false Adonis supports handful or ways to allow proxy | ||
55 | | values. Read documentation for that. | ||
56 | | | ||
57 | */ | ||
58 | trustProxy: false, | ||
59 | |||
60 | /* | ||
61 | |-------------------------------------------------------------------------- | ||
62 | | Subdomains | ||
63 | |-------------------------------------------------------------------------- | ||
64 | | | ||
65 | | Offset to be used for returning subdomains for a given request.For | ||
66 | | majority of applications it will be 2, until you have nested | ||
67 | | sudomains. | ||
68 | | cheatsheet.adonisjs.com - offset - 2 | ||
69 | | virk.cheatsheet.adonisjs.com - offset - 3 | ||
70 | | | ||
71 | */ | ||
72 | subdomainOffset: 2, | ||
73 | |||
74 | /* | ||
75 | |-------------------------------------------------------------------------- | ||
76 | | JSONP Callback | ||
77 | |-------------------------------------------------------------------------- | ||
78 | | | ||
79 | | Default jsonp callback to be used when callback query string is missing | ||
80 | | in request url. | ||
81 | | | ||
82 | */ | ||
83 | jsonpCallback: 'callback', | ||
84 | |||
85 | |||
86 | /* | ||
87 | |-------------------------------------------------------------------------- | ||
88 | | Etag | ||
89 | |-------------------------------------------------------------------------- | ||
90 | | | ||
91 | | Set etag on all HTTP response. In order to disable for selected routes, | ||
92 | | you can call the `response.send` with an options object as follows. | ||
93 | | | ||
94 | | response.send('Hello', { ignoreEtag: true }) | ||
95 | | | ||
96 | */ | ||
97 | etag: false | ||
98 | }, | ||
99 | |||
100 | views: { | ||
101 | /* | ||
102 | |-------------------------------------------------------------------------- | ||
103 | | Cache Views | ||
104 | |-------------------------------------------------------------------------- | ||
105 | | | ||
106 | | Define whether or not to cache the compiled view. Set it to true in | ||
107 | | production to optimize view loading time. | ||
108 | | | ||
109 | */ | ||
110 | cache: Env.get('CACHE_VIEWS', true) | ||
111 | }, | ||
112 | |||
113 | static: { | ||
114 | /* | ||
115 | |-------------------------------------------------------------------------- | ||
116 | | Dot Files | ||
117 | |-------------------------------------------------------------------------- | ||
118 | | | ||
119 | | Define how to treat dot files when trying to server static resources. | ||
120 | | By default it is set to ignore, which will pretend that dotfiles | ||
121 | | does not exists. | ||
122 | | | ||
123 | | Can be one of the following | ||
124 | | ignore, deny, allow | ||
125 | | | ||
126 | */ | ||
127 | dotfiles: 'ignore', | ||
128 | |||
129 | /* | ||
130 | |-------------------------------------------------------------------------- | ||
131 | | ETag | ||
132 | |-------------------------------------------------------------------------- | ||
133 | | | ||
134 | | Enable or disable etag generation | ||
135 | | | ||
136 | */ | ||
137 | etag: true, | ||
138 | |||
139 | /* | ||
140 | |-------------------------------------------------------------------------- | ||
141 | | Extensions | ||
142 | |-------------------------------------------------------------------------- | ||
143 | | | ||
144 | | Set file extension fallbacks. When set, if a file is not found, the given | ||
145 | | extensions will be added to the file name and search for. The first | ||
146 | | that exists will be served. Example: ['html', 'htm']. | ||
147 | | | ||
148 | */ | ||
149 | extensions: false | ||
150 | }, | ||
151 | |||
152 | locales: { | ||
153 | /* | ||
154 | |-------------------------------------------------------------------------- | ||
155 | | Loader | ||
156 | |-------------------------------------------------------------------------- | ||
157 | | | ||
158 | | The loader to be used for fetching and updating locales. Below is the | ||
159 | | list of available options. | ||
160 | | | ||
161 | | file, database | ||
162 | | | ||
163 | */ | ||
164 | loader: 'file', | ||
165 | |||
166 | /* | ||
167 | |-------------------------------------------------------------------------- | ||
168 | | Default Locale | ||
169 | |-------------------------------------------------------------------------- | ||
170 | | | ||
171 | | Default locale to be used by Antl provider. You can always switch drivers | ||
172 | | in runtime or use the official Antl middleware to detect the driver | ||
173 | | based on HTTP headers/query string. | ||
174 | | | ||
175 | */ | ||
176 | locale: 'en' | ||
177 | }, | ||
178 | |||
179 | logger: { | ||
180 | /* | ||
181 | |-------------------------------------------------------------------------- | ||
182 | | Transport | ||
183 | |-------------------------------------------------------------------------- | ||
184 | | | ||
185 | | Transport to be used for logging messages. You can have multiple | ||
186 | | transports using same driver. | ||
187 | | | ||
188 | | Available drivers are: `file` and `console`. | ||
189 | | | ||
190 | */ | ||
191 | transport: 'console', | ||
192 | |||
193 | /* | ||
194 | |-------------------------------------------------------------------------- | ||
195 | | Console Transport | ||
196 | |-------------------------------------------------------------------------- | ||
197 | | | ||
198 | | Using `console` driver for logging. This driver writes to `stdout` | ||
199 | | and `stderr` | ||
200 | | | ||
201 | */ | ||
202 | console: { | ||
203 | driver: 'console', | ||
204 | name: 'adonis-app', | ||
205 | level: 'info' | ||
206 | }, | ||
207 | |||
208 | /* | ||
209 | |-------------------------------------------------------------------------- | ||
210 | | File Transport | ||
211 | |-------------------------------------------------------------------------- | ||
212 | | | ||
213 | | File transport uses file driver and writes log messages for a given | ||
214 | | file inside `tmp` directory for your app. | ||
215 | | | ||
216 | | For a different directory, set an absolute path for the filename. | ||
217 | | | ||
218 | */ | ||
219 | file: { | ||
220 | driver: 'file', | ||
221 | name: 'adonis-app', | ||
222 | filename: 'adonis.log', | ||
223 | level: 'info' | ||
224 | } | ||
225 | }, | ||
226 | |||
227 | /* | ||
228 | |-------------------------------------------------------------------------- | ||
229 | | Generic Cookie Options | ||
230 | |-------------------------------------------------------------------------- | ||
231 | | | ||
232 | | The following cookie options are generic settings used by AdonisJs to create | ||
233 | | cookies. However, some parts of the application like `sessions` can have | ||
234 | | separate settings for cookies inside `config/session.js`. | ||
235 | | | ||
236 | */ | ||
237 | cookie: { | ||
238 | httpOnly: true, | ||
239 | sameSite: false, | ||
240 | path: '/', | ||
241 | maxAge: 7200 | ||
242 | } | ||
243 | } | ||