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